Sending data off-chip

ABSTRACT

A processor comprising multiple tiles on the same chip, and an external interconnect for communicating data off-chip in the form of packets. The external interconnect comprises an external exchange block configured to provide flow control and queuing of the packets. One of the tiles is nominated by the compiler to send an external exchange request message to the exchange block on behalf of others with data to send externally. The exchange sends an exchange-on message to a first of these tiles, to cause the first tile to start sending packets via the external interconnect. Then, once this tile has sent its last data packet, the exchange block sends an exchange-off control packet to this tile to cause it to stop sending packets, and sends another exchange-on message to the next tile with data to send, and so forth.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the priority benefit under 35 U.S.C. § 119 ofUnited Kingdom Patent Application No. 1816930.0, filed Oct. 17, 2018,United Kingdom Patent Application No. 1717294.1, filed Oct. 20, 2017,and United Kingdom Patent Application No. 1717293.3, filed Oct. 20,2017, the entire contents of which are incorporated herein by reference.

TECHNICAL FIELD

The present disclosure relates to a mechanism for sending data off-chipover an external interconnect from a processor comprising an arrangementof multiple tiles on the same chip (die), each tile comprising its ownmemory and processing unit.

BACKGROUND

A multi-threaded processor is a processor which is capable of executingmultiple program threads alongside one another. The processor maycomprise some hardware that is common to the multiple different threads(e.g. a common instruction memory, data memory and/or execution unit);but to support the multi-threading, the processor also comprises somededicated hardware specific to each thread.

The dedicated hardware comprises at least a respective context registerfile for each of the number of threads that can be executed at once. A“context”, when talking about multi-threaded processors, refers to theprogram state of a respective one of the threads being executedalongside one another (e.g. program counter value, status and currentoperand values). The context register file refers to the respectivecollection of registers for representing this program state of therespective thread. Registers in a register file are distinct fromgeneral purpose memory in that register addresses are fixed as bits ininstruction words, whereas memory addresses can be computed by executinginstructions. The registers of a given context typically comprise arespective program counter for the respective thread, and a respectiveset of operand registers for temporarily holding the data acted upon andoutput by the respective thread during the computations performed bythat thread. Each context may also have a respective status register forstoring a status of the respective thread (e.g. whether it is paused orrunning). Thus each of the currently running threads has its ownseparate program counter, and optionally operand registers and statusregister(s).

One possible form of multi-threading is parallelism. That is, as well asmultiple contexts, multiple execution pipelines are provided: i.e. aseparate execution pipeline for each stream of instructions to beexecuted in parallel. However, this requires a great deal of duplicationin terms of hardware.

Instead therefore, another form of multi-threaded processor employsconcurrency rather than parallelism, whereby the threads share a commonexecution pipeline (or at least a common part of a pipeline) anddifferent threads are interleaved through this same, shared executionpipeline. Performance of a multi-threaded processor may still beimproved compared to no concurrency or parallelism, thanks to increasedopportunities for hiding pipeline latency. Also, this approach does notrequire as much extra hardware dedicated to each thread as a fullyparallel processor with multiple execution pipelines, and so does notincur so much extra silicon.

One form of parallelism can be achieved by means of a processorcomprising an arrangement of multiple tiles on the same chip (i.e. samedie), each tile comprising its own separate respective processing unitand memory (including program memory and data memory). Thus separateportions of program code can be run in parallel on different ones of thetiles. The tiles are connected together via an on-chip interconnectwhich enables the code run on the different tiles to communicate betweentiles. In some cases the processing unit on each tile may itself runmultiple concurrent threads on tile, each tile having its own respectiveset of contexts and corresponding pipeline as described above in orderto support interleaving of multiple threads on the same tile through thesame pipeline.

In general, there may exist dependencies between the portions of aprogram running on different tiles. A technique is therefore required toprevent a piece of code on one tile running ahead of data upon which itis dependent being made available by another piece of code on anothertile. There are a number of possible schemes for achieving this, but thescheme of interest herein is known as “bulk synchronous parallel” (BSP).According to BSP, each tile performs a compute phase and an exchangephase in an alternating cycle. During the compute phase each tileperforms one or more computation tasks locally on tile, but does notcommunicate any results of its computations with any others of thetiles. In the exchange phase each tile is allowed to exchange one ormore results of the computations from the preceding compute phase toand/or from one or more others of the tiles in the group, but does notyet proceed to the next compute phase. Further, according to the BSPprinciple, a barrier synchronization is placed at the juncturetransitioning from the compute phase into the exchange phase, ortransitioning from the exchange phase into the compute phase, or both.That is it say, either: (a) all tiles are required to complete theirrespective compute phases before any in the group is allowed to proceedto the next exchange phase, or (b) all tiles in the group are requiredto complete their respective exchange phases before any tile in thegroup is allowed to proceed to the next compute phase, or (c) both. Insome scenarios a tile in the compute phase may be allowed to communicatewith other system resources such as a network card or storage disk, aslong as no communication with other tiles in the group is involved.

An example use of multi-threaded and/or multi-tiled processing is foundin machine intelligence. As will be familiar to those skilled in the artof machine intelligence, a machine intelligence algorithm is basedaround performing iterative updates to a “knowledge model”, which can berepresented by a graph of multiple interconnected nodes. Each noderepresents a function of its inputs. Some nodes receive the inputs tothe graph and some receive inputs from one or more other nodes, whilstthe output of some nodes form the inputs of other nodes, and the outputof some nodes provide the output of the graph (and in some cases a givennode may even have all of these: inputs to the graph, outputs from thegraph and connections to other nodes). Further, the function at eachnode is parameterized by one or more respective parameters, e.g.weights. During a learning stage the aim is, based on a set ofexperiential input data, to find values for the various parameters suchthat the graph as a whole will generate a desired output for a range ofpossible inputs. Various algorithms for doing this are known in the art,such as a back propagation algorithm based on stochastic gradientdescent. Over multiple iterations based on the input data, theparameters are gradually tuned to decrease their errors, and thus thegraph converges toward a solution. In a subsequent stage, the learnedmodel can then be used to make predictions of outputs given a specifiedset of inputs or to make inferences as to inputs (causes) given aspecified set of outputs.

The implementation of each node will involve the processing of data, andthe interconnections of the graph correspond to data to be exchangedbetween the nodes. Typically, at least some of the processing of eachnode can be carried out independently of some or all others of the nodesin the graph, and therefore large graphs expose great opportunities forconcurrency and/or parallelism.

SUMMARY

According to one aspect disclosed herein there is provided a processorcomprising an arrangement of multiple tiles on the same chip, each tilecomprising its own separate respective processing unit and memoryincluding program memory and data memory, wherein separate portions ofprogram code are arranged to run in parallel in different ones of thetiles. The processor further comprises an on-chip interconnect arrangedto enable the code run on the different tiles to communicate betweentiles; and an external interconnect comprising a non-time-deterministicmechanism implemented in dedicated hardware logic for communicating dataoff-chip, whereby data is sent over the external interconnect in theform of packets, each packet having a header in which a destinationaddress is present, and whereby communication of packets over theexternal interconnect is non-time-deterministic. The externalinterconnect comprises an external exchange block configured to provideflow control and queuing of the packets. One of the tiles is nominatedby a compiler of the code to send an external exchange request messageto the exchange block, the external exchange request message comprisingone or more control packets indicating which of the tiles have datapackets to send to a destination on another chip (the data packetscontaining content). To perform said flow control, the exchange block isconfigured to: A) send an exchange-on control packet to a first of thetiles indicated in the exchange request message as having data to sendexternally, to cause the first tile to start sending packets to theirdestinations via the external interconnect, being queued in a queue ofthe exchange block; and then B) once this tile has sent its last datapacket, send an exchange-off control packet to this tile to cause it tostop sending packets, and send another exchange-on control packet to thenext tile indicated in the exchange request message as having datapackets to send (and so forth). I.e. the sending of the exchange-oncontrol packet and the exchange-off control packet is repeated for eachtile in turn indicated in the exchange request message, until all thetiles indicated in the exchange request message have sent theirrespective packets.

Thus in a given program, the compiler can nominate one or more of thetiles to perform input and/or output (I/O). This may be subset of thetiles on the chip (e.g. one, two or four of the tiles out of tens orhundreds of tiles), but in general any or all of the tiles could beprogrammed to perform the I/O. In operation, the compiled program on anominated one of the I/O tiles sends the exchange request message onbehalf of the other tiles that are to send data off-chip, telling theexchange block which are those tiles with data to send. Based on this,the exchange block arranges that all the tiles with data to send getserviced in a non-contended schedule. Via the exchange request, thecompiled program can demand of the exchange block the right to senddata. The exchange request on behalf of a given sending tile lastsindefinitely (until all that tile's current data is sent). However,there are multiple sending tiles all trying to access the same queue ofthe exchange block. The exchange block thus enforces that the multiplesending tiles are serviced in order, one after another, and thusresolves the contention. In embodiments the exchange block determineswhat order the sending tiles are serviced in (though in embodiments theparticular order selected does not matter, as long as they are servicedone after another).

As long as the tiles between them have enough data to send, thedescribed mechanism can always keep the external bandwidth saturated(e.g. the bandwidth of an external connection such as a network or busbetween the external interconnect and the destination or destination,via which the packets are sent between the external interconnect and thedestination or destination). Even though the exchange may not beefficient at a level of one individual tile, the external exchangerequest and exchange block see to it that the external connection iskept busy, and preferably that its bandwidth is kept substantiallysaturated. This means no other special arrangements have to be made tokeep the bandwidth saturated.

The data packets are packets that contain content (as opposed to controlpackets which are used for control signalling).

The external interconnect is so-called because it is for communicatingexternally. It may be implemented internally on the same chip as thetiles. Alternatively it could be implemented outside the chip.

The program memory and data memory may be implemented in differentaddressable memory units. Alternatively, the program memory and datamemory may be implemented in different regions of the same addressablememory units. A combination of these approaches may also be used.

In embodiments the destination of at least some of the packets may beanother tile or tiles on another chip. In embodiments the destination ofat least some of the packets may be a host subsystem comprising a hostCPU, and said processor may be arranged as a work accelerator to performwork allocated by the host. In further embodiments the destination of atleast some of the packets may be a storage device.

The external interconnect is a non-time deterministic interconnect,meaning the communication of packets over the external interconnect isnon-time-deterministic. In embodiments the internal interconnect may bea time-deterministic interconnect, the communication of data betweentiles on chip being time-deterministic.

In this case the exchange block, and exchange protocol comprising theexchange-on, exchange-off and exchange request message, advantageouslyprovide a mechanism or “gear box” to bridge the gap between thetime-deterministic realm and the non-time-deterministic realm. Theyallow the time-deterministic realm to request a time deterministicschedule from the non-time-deterministic realm.

In embodiments, at the physical layer the external interconnectmechanism may be lossy, but at the transaction layer the mechanism maynot be lossy due to an architecture whereby, if a packet is notacknowledged, it will be resent automatically by hardware in theexternal interconnect. Note however that the exchange request mechanismcan in fact apply regardless of the cause of the loss, or more generallythe cause of the non-time determinism, over the external interconnect.For example in alternative embodiments the external interconnectmechanism may be lossless at the physical layer but lossy at thetransaction layer. In another alternative embodiment the externalinterconnect may be lossless at the physical and transaction layer, butmay be non-time-deterministic because, e.g., the mechanism involvesqueuing and/or out-of-order transmission. A lossy transaction layerprotocol, or a congested lossless interconnect, may also result innon-time deterministic transmission that would benefit from theapplication of the disclosed mechanism to bridge between the timedeterministic and non-time-deterministic realms.

The exchange mechanism can also apply regardless of whether the externallink or connection to the destination is lossy (e.g. ethernet) or (asabove, reliable, e.g. PCI). In the event of a lossy link, as long aspacket loss was detected then the situation can be recovered by re-doingthe entire exchange. Thus the scope of the disclosed techniques cancover the use of both lossy (e.g. ethernet) and reliable (e.g. PCI)external fabrics.

In embodiments, the exchange block may be configured so as, if at anytime the exchange block is unable to continue sending packets over theexternal interconnect, the exchange block sends an exchange-off controlpacket to the sending tile before the exchange block's queue overflows;and once the congestion is cleared and the exchange block has sufficientspace in its queue it will send an exchange-on control packet to thesending tile allowing it to continue transmitting its content.

The congestion may be due to oversubscription of the interconnect, e.g.by other tiles and/or other exchange blocks (i.e. due to the queuefilling up). Alternatively or additionally, the congestion may be due toprevious packet loss and re-transmission in the external interconnect.

In embodiments, the external interconnect may take the form of a networkin which case the header further comprises information for routingpurposes.

In embodiments, the external interconnect may be configured to useclock-data-recovery technology to infer a clock from a received datastream having sufficient data signal transitions to maintain a bit-lock.Alternatively an explicit clock could be used. E.g. in alternativeembodiments, the external interconnect may be configured to use a clocksignalled explicitly by the destination or from elsewhere (e.g. a commonclock common to both the destination and the external interconnect).

In embodiments the external interface may be configured to send thepackets to the destination or destination via a PCI, PCIe or Ethernetbus or network between the external interface and the destination ordestinations. More generally however the disclosed mechanism is notlimited to use in conjunction with these particular external protocolsand can be used in conjunction with any type of external bus, network orother such connection.

In embodiments, a group of some or all of the tiles modules may beprogrammed to operate in a series of bulk synchronous parallel, BSP,supersteps, whereby in each superstep the group performs:

-   -   a compute phase in which the tiles in the group performs        computations but does not exchange results of the computations        outside the chip, and then    -   an exchange phase in which at least some of the tiles in the        group exchange the results of one or more of the computations        with the off-chip destination or destinations, said at least        some of the tiles being those indicated in the exchange request;        and    -   the group is synchronized by a barrier synchronization between        each current superstep in the series and the next, whereby each        tile in the group waits for all in the group to complete the        compute phase of the current superstep before advancing to the        exchange phase of the next superstep.

In embodiments, the on-chip and/or external interconnect may comprisehardware logic configured to conduct said barrier synchronization by:

-   -   receiving a sync request from each of the tiles in the group,        and    -   issuing a sync acknowledgement on condition that the sync        requests are received from all of the group;    -   wherein each of the tiles in the group is further configured to        suspend instruction issue in the respective processing unit the        issue of the sync acknowledgment.

In embodiments, the respective processing unit on each of the tiles maybe configured to execute instructions from a predefined instruction set;and wherein the instruction set of some or all of the tiles comprises async instruction which causes the tile on which it is executed to sendthe sync request.

In embodiments, the exchange block may comprise a plurality of exchangeblock contexts, each configured to implement an instance of said flowcontrol mechanism for a different respective subset of the tiles.

In embodiments the processor may comprise at least twenty of said tiles.In embodiments the processor may comprise at least fifty of said tiles.In embodiments the processor may comprise at least one hundred of saidtiles.

In embodiments, the processor may be arranged to perform said sendingwithout using a DMA engine, wherein instead a subset of the tiles arenominated by the compiler to act as I/O tiles to perform said sending ofdata to the off-chip destination and/or to read data from the off-chipdestination, said subset being the tiles indicated in the exchangerequest message. In embodiments the processor comprises no on-chip DMAengine and is arranged instead to use said nominated I/O tiles. In someembodiments the system comprises no on- or off-chip DMA engine at all.

To transfer data via a processor, the processor has to execute loadinstructions to load values from memory into its registers, and sendinstructions to send the values from its registers out to an externalport or other such interface. In conventional processors with a singleprocessing unit or small number of cores, this consumes a large amountof the processor's processing cycles executing load and sendinstructions just to transfer data off-chip. Hence normally it is notdesired to burden a processor with this. Instead, a DMA (direct memoryaccess) engine is usually provided on the same chip as the processor.The DMA engine may be programmable or non-programmable. A programmableDMA executes separate code which performs an external transfer on behalfof the processor. A non-programmable DMA engine enables the processor tosend a descriptor to the DMA engine specifying a series of externaltransactions, and the DMA engine will enact the specified transactionswithout further involvement of the processor. Either way, the processoris thus relieved of some of all of the processing that would otherwisebe involved in transferring data off-chip.

However, a transfer performed by the processor itself rather than a DMAengine can actually be faster. Further, in embodiments of the presentlydisclosed processor, the processor may in fact comprise a large numberof tiles (e.g. ≥20 tiles, ≥50 tiles, or ≥100 tiles). This presents anopportunity to do away with the DMA engine without consuming too much ofthe processor's resources performing I/O. Instead, the compilernominates only a subset of the tiles to act as I/O tiles. E.g. this maybe, say, only 2 or 4 tiles out of tens, or a hundred or more tiles; orfewer than 1%, 2%, 5% or 10% of the tiles on the chip. Thus theperformance argument for a DMA engine no longer applies.

This scheme can be particularly appropriate in the case of a BSP schemewhere it is chosen to serialize compute and exchange. I.e. since most orall of the compute is being separated from the exchange phase anyway,the burden of involving the processor in the off-chip transfer is lessof an issue, whilst in the compute phase there will be no exchangeanyway so no performance impact on the computation.

In embodiments, the external interface may be configured to send thepackets to the destination or destination via a connection (e.g. saidbus or network) between the external interface and the destination ordestinations, said link having a first bandwidth for sending thepackets; and wherein each of the tiles has a second bandwidth forsending the packets, wherein the number of tiles nominated as I/O tilesmay be at least the first bandwidth divided by the second bandwidthrounded up or down to the nearest whole number.

The optimal number of nominated tiles depends on the external I/Obandwidth of one tile compared to the I/O bandwidth of the chip. E.g. inone exemplary implementation, each tile has 32 Gbps bandwidth fullduplex, and the chip has 1536 Gbps external SERDES bandwidth. So on thatbasis 48 tiles are required to fully subscribe the off-chip bandwidth.In other implementations the numbers may be different, and the optimalnumber will depend on the bandwidth of the tile versus the externaloff-chip bandwidth of the chip.

Another advantage is that, in embodiments, all data movement can bedetermined by the compiler, which helps with determinism.

According to another aspect disclosed herein there is provided a systemcomprising the processor and the off-chip destination or destinations ofthe packets.

According to another aspect disclosed herein there is provided a methodof operating the processor or system, the method comprising: running thecompiler on a computer in order to compile the code, wherein thecompilation comprises the compiler nominating which of the tiles is tosend the exchange request message; and running the compiled code on theprocessor, thereby causing the nominated tile to send the exchangerequest message to the exchange block to cause the exchange block toperform said queuing and flow control, and causing the tiles indicatedin the exchange request message to perform the sending of their packets.

In embodiments the compilation may comprise the compiler nominatingwhich of the tiles are the I/O tiles.

BRIEF DESCRIPTION OF THE DRAWINGS

To aid understanding of the present disclosure and to show howembodiments may be put into effect, reference is made by way of exampleto the accompanying drawings in which:

FIG. 1 is a schematic block diagram of a multi-threaded processing unit,

FIG. 2 is a schematic block diagram of a plurality of thread contexts,

FIG. 3 schematically illustrates a scheme of interleaved time slots,

FIG. 4 schematically illustrates a supervisor thread and plurality ofworker threads,

FIG. 5 is a schematic diagram of logic for aggregating exit states ofmultiple threads,

FIG. 6 schematically illustrates synchronization amongst worker threadson the same tile,

FIG. 7 is a schematic block diagram of a processor chip comprisingmultiple tiles,

FIG. 8 is a schematic illustration of a bulk synchronous parallel (BSP)computing model,

FIG. 9 is another schematic illustration of a BSP model,

FIG. 10 is a schematic illustration of BSP between multi-threadedprocessing units,

FIG. 11 is a schematic block diagram of an interconnect system,

FIG. 12 is a schematic illustration of system of multiple interconnectedprocessor chips,

FIG. 13 is a schematic illustration of a multi-tier BSP scheme,

FIG. 14 is another schematic illustration of a system of multipleprocessor chips,

FIG. 15 is a schematic illustration of a graph used in a machineintelligence algorithm,

FIG. 16 schematically illustrates an arrangement for exchanging databetween tiles,

FIG. 17 schematically illustrates a scheme of exchange timings,

FIG. 18 illustrates example wiring for synchronizing between chips, and

FIG. 19 schematically illustrates a flow control mechanism for externalexchange,

FIG. 20 schematically illustrates a program flow involving a host syncproxy, and

FIG. 21 is a schematic block diagram of a system of multiple processormodules.

DETAILED DESCRIPTION OF EMBODIMENTS

FIG. 21 shows an example system in accordance with embodiments of thepresent disclosure. The system comprises multiple processor modules.These may comprise processors on different chips (dies) 2, and/ordifferent processor tiles 4 on a given chip 2. In embodiments the systemcomprises multiple processor chips 2 connected together by an external(inter-chip) interconnect 72. The chips 2 could be packaged on the sameintegrated circuit (IC) package, or different packages, or some on thesame package and some on different packages. In embodiments the externalinterconnect 72 may be a non-time-deterministic interconnect, wherebyexchange of data over this interconnect is non-time-deterministic innature. Further details of this will be discussed shortly, and alsolater with respect to FIG. 19.

Further, in embodiments, each of one, some or all of the processor chips2 may comprise a respective array of tiles 4. Each tile 4 comprises arespective processing unit 10 and memory 11. In embodiments theprocessing unit 10 on each of the tiles 4 is a multithreaded processingunit 10 for running multiple concurrent threads on the tile 4. Anexample implementation of the will be discussed in more detail laterwith reference of FIGS. 1 to 4. The tiles 4 are connected together viaan internal (on-chip), inter-tile interconnect 34 which enables transferof data between tiles 4. In embodiments the inter-tile interconnect 34may be a time-deterministic interconnect, enabling time-deterministicexchange of data between tiles 4. An example implementation of this willbe described in more detail later with reference to FIGS. 16 and 17. Theinternal interconnect 34 may also enable synchronization between tiles4. Further example details of this will be discussed in relation to,e.g., FIGS. 7 and 11.

Each tile 4 comprises a respective processing unit 10 comprising anexecution unit 13, e.g. pipeline. Each 4 tile also comprises arespective memory 11 comprising a respective instruction memory 12 forstoring code to be executed by the respective execution unit 10, and arespective data memory storing data operated on by the respectiveexecuted code (data to be operated on by the code, and/or data resultingfrom the operations). The execution unit 13 comprises a fetch stage 14,decode stage 16 and execution stage 18, preferably arranged in apipelined manner. The fetch stage 14 controls the issue of machine codeinstructions from the instruction memory 12 into the rest of thepipeline or execution unit 13, to be decoded and executed by the decodeand execution stages 16, 18 respectively. If instruction issue is pausedon the respective tile 4, this means the pipeline or execution unit 13stops executing its respective code until instruction issue is resumed.

In embodiments the processing unit 10 on each tile 4 is a multi-threadedprocessing unit 10, arranged to run multiple concurrent threadsinterleaved through the same respective pipeline 13, each in arespective time-slot with its program state held in a respective set ofcontext registers. The threads on each tile 4 may include a respectivesupervisor thread and a respective plurality of worker threads. Exampleimplementation details for this will be discussed in more detail laterwith respect to FIGS. 1 to 4. When instruction issue is paused orsuspended, it is suspended for all slots on the tile 4 (i.e.instructions from no threads are issued).

Each tile 4 also comprises an exchange interface 311 for handling theexchange of data between the respective data memory 22 and the exteriorof the tile 4 via the internal or external interconnect 36, 76(depending on whether an internal or an external exchange).

In embodiments the system may further comprise a host subsystem 93, andthe processor modules 2, 4 may be arranged as accelerator processors(XPUs) to provide an accelerator subsystem 300 to the host 93. The host93 comprises at least one host processor configured with the role of ahost for allocating work to the accelerator subsystem 300, and each ofthe accelerators 2, 4 in the accelerator subsystem 300 is arranged toperform work allocated by the host 93. The host 93 is privileged and theaccelerator devices 2, 4 undertake work delegated by the host 93. Inembodiments each of the accelerator processor chips 2 may take the formof an IPU (“Intelligence Processing Unit”) designed specially for use asa machine intelligence accelerator processor.

The host 93 may take the form of a single host CPU, or it may alsocomprises one or more gateway processors (not shown) arranged asintermediaries between the host CPU and the accelerator processors 2.One or more of the gateways may also be connected to one or more networkattached storage devices (NASs). The gateway(s) may for example bearranged to buffer streams of data destined for the accelerators 2 fromthe NAS(s); such as sequences of images, audio streams or other streamsof experience data which are to be streamed to the acceleratorprocessors 2 in order for them to conduct machine learning basedthereon, e.g. to train a neural network to identify objects, faces,sounds, or other structures in the received experience data.

The inter-processor interconnect 72 also connects the acceleratorprocessors 2 to the host 93 via a suitable host interface 97 such as aPCI, PCIe or Ethernet interface. The inter-processor interconnect 72comprises a network of data paths 301 for exchanging data betweenaccelerator processors 2 and/or between accelerator 2 and host 93.

The interconnect(s) 34, 72 also comprise a mechanism for synchronizingbetween the processor modules 2, 4, and in embodiments also forsynchronizing between the host 93 and the processor modules 2, 4. Thismechanism may comprise a synchronization (sync) network 96 separate fromthe data paths 301 of the inter-processor interconnect 72, plussynchronization logic 36, 76, 98 for sending sync requests and syncacknowledgment signals over the sync network 96. This mechanism may beused to implement a BSP scheme.

The synchronization logic may comprise an internal sync controller 36 inthe internal interconnect 34, for synchronizing between a group of someor all of the tiles 4 on a given chip 2. When a tile 4 has reached acertain point, e.g. finished its compute phase, then it sends a syncrequest over the sync network 96 and suspends instruction issue on thattile 4 until it receives back a sync acknowledgment signal over the syncnetwork 96. In the case of an internal sync, the internal synccontroller 36 only returns the sync acknowledgment once a sync requesthas been received from all the tiles 4 in the group. The synchronizationlogic 36 may also comprise an external sync controller 76 forsynchronizing between a group of some or all of the chips 2. Again whena tile 4 has reached a certain point, e.g. finished its compute phase,then it sends a sync request over the sync network 96 and suspendsinstruction issue on that tile 4 until it receives back a syncacknowledgment signal over the sync network 96.

In the case of an external sync not involving host involvement, theexternal sync controller 76 is responsible for returning the syncacknowledgment. It does so only once a sync request has been receivedfrom all the chips 2 in the group. In the case of an external syncrequiring host involvement, another piece of logic called the host syncproxy (HSP) 98 is responsible for returning the sync acknowledgment. Itdoes so only if the host has written to a register in the HSP 98granting the sync barrier to be passed. For illustrative purposes inFIG. 21 the HSP 98 is shown as receiving the sync request and issuingthe sync acknowledgement, but it will be appreciated this may also bedone by the internal or external sync logic 36, 76 depending on thehierarchical level of the sync operation and whether host involvement isrequired. The HSP 98 may be considered part of the external interconnect76, at least conceptually or schematically speaking. Physically it maybe implemented either off-chip in the hardware of the interconnect 76between chips, or alternatively on-chip in the same chip as one or moreof the gateways if gateways are used. Example details of the synccontrollers 36, 76 will be discussed later with respect to, e.g., FIGS.11 and 14. Example implementation details of HSP 98 will be discussedlater with respect to FIGS. 18 and 20.

In embodiments, the sending of a sync request may be triggered byexecuting a dedicated SYNC instruction included in the instruction setof the tiles 4. The hierarchical level of the sync operation (e.g.on-chip, between chips, or host involvement) may be set by an operand ofthe SYNC instruction. Example implementation details of this will alsobe discussed later.

In embodiments the inter-processor interconnect 72 is anon-time-deterministic interconnect, in that the transmission of dataover the data paths 301 of this interconnect 72 (as opposed to syncsignalling over the sync network 96) is non-time-deterministic innature. I.e. the timing cannot be known or at least not guaranteed, e.g.because delivery is not guaranteed and therefore may requireretransmission.

It may be less practical to make communications between chipstime-deterministic. External (off-chip) communication experiencesgreater uncertainty compared to internal (on-chip) communication. Forinstance, external exchange is less local, meaning wires reach furtherand hence are more capacitive, and more vulnerable to noise. This inturn may result in loss and hence the need for flow control mechanismwhich provides for retransmission at the physical layer. Alternatively,the interconnect between chips 2 may be lossless at the physical and/orlink layer, but is actually lossy at the higher networking layer due tocontention of network layer flows between different sources anddestinations causing queues to be over-flowed and packets dropped.

It would be desirable to provide a mechanism for synchronizing theexchange of data between chips 2. For instance it may be desired tofacilitate a BSP exchange scheme across a system comprising multipleprocessing tiles arranged into different time-deterministic domains,wherein communications between tiles in the same domain aretime-deterministic, but communications between tiles in differentdomains are non-time-deterministic.

According to embodiments disclosed herein, the external interconnect 72is equipped with at least one exchange block (XB) 78 configured tooperate as follows.

When there is an external exchange to perform between tiles 4 ondifferent chips 2, software (e.g. supervisor thread) running on at leastone of the tiles 4 sends an external exchange request message (XREQ) tothe exchange block 78. The exchange request may be sent as a controlpacket over the same data path 301 as used to exchange data (i.e. datacontent). However it is not excluded that it could be signalled over aseparate control path built into the external interconnect 72. Inembodiments a single one of the tiles 4 sends the exchange request onbehalf of all the tiles 4 with data to send externally (off-chip) in acurrent exchange phase (e.g. an exchange phase of a BSP superstep), orat least all of those within a certain group (which in embodiments maybe the same as the sync group). The compiler determines which tile 4 isto send the exchange request on behalf of which others and complies thesoftware (e.g. supervisor thread) on the responsible tile 4 with asuitable instruction or instructions to send the exchange request. Thismay be possible for example because the system is running a pre-compiledstatic graph.

The exchange request message(s) tells the exchange block 78 which tiles4 have data content to exchange externally in the current exchangephase. The exchange block 78 starts with one of these indicated tiles 4by sending an “exchange-on” message (XON) to that tile 4. In response,the tile 4 in question begins transmitting data packets over theexternal interconnect 72 each indicating a destination tile 4 in aheader of the packet. The exchange block 78 comprises a queue (FIFObuffer) arranged to receive and buffer the packets sent over theexternal interconnect 72. At the other end of the queue the exchangeblock 78 routes the packets to their destination based on their headers.Once the currently transmitting tile 4 has sent its last packet, theexchange block 78 sends an exchange-off (XOFF) message to that tile 4(the exchange block 78 can determine that a given packet is the lastpacket from a given tile 4 based on a ‘last packet’ flag in the packetheader emitted by the tile). The exchange block 78 then sends anexchange-on to the next tile 4 indicated in the exchange request(s) ashaving data to send, and so forth until all the indicated tiles 4 havesent all the packets they had to send in the current exchange phase. Theexchange-on and exchange-off messages may be sent as control packetsover the same data path 301 as used to exchange data (i.e. datacontent). Alternatively it is not excluded that they could be signalledover a separate control path built into the external interconnect 72.

In embodiments the exchange mechanism does not distinguish betweentransmission from external tiles 4 and external sources other than tiles4, or at least does not exclude transmissions from other such sources.For example such other external sources could comprise the host 93,and/or one or more other external sources such as an external storagedrive, network card, etc. In such cases the exchange request (XREQ) fromone of the tiles 4 (e.g. as determined by the compiler) may also specifyone or more of the other external sources, e.g. host 93.

Thus each tile 4 is advantageously provided with a mechanism to exchangedata between domains that are non-time-deterministic or asynchronouswith respect to one another.

In embodiments the disclosed mechanism may be used to implement a BSPscheme. As illustrated in FIGS. 8 and 9, in a BSP scheme, the systemoperates in an alternating cycle of exchange phase 50 and a computephase 52. In each cycle, the exchange phase 50 comprises a respectiveexchange phase on each tile 4, and the compute phase 52 comprises arespective compute phase on each tile 4. In the present case a barriersynchronization 30 is placed between the compute phase 52 and nextexchange phase 50 each cycle. I.e. all the tiles 4 are required tocomplete their respective compute phase 52 before any is allowed toproceed to the next exchange phase 50. In embodiments this may beimplemented by the above-described synchronization mechanism based onthe system of sync requests and acknowledgments sent via the syncnetwork 96, and on the sync logic 36, 76 in the interconnects 34, 72(and in embodiments the HSP 98). That is, when a tile 4 has completedits current compute phase 52 and is ready to sync, then software on thattile 4 (e.g. the supervisor thread) sends out a sync request andsuspends instruction issue until a sync acknowledgement is receivedback. In embodiments this is done by executing a SYNC instruction on therespective tile 4. In embodiments this is an instance of the SYNCinstruction with its mode operand set to specify a barrier typesynchronization (and in embodiments also specifying one of a pluralityof different possible sync groups amongst which to perform the barriersynchronization).

When a given tile 4 has completed its current respective exchange phase50, it can proceed directly to its next compute phase 52—it does notneed to wait for all the other tiles 4 to complete their exchangephases. Nonetheless, the compute phase 52 on the given tile 4 may stillbe dependent on receiving data from one or some other tiles 4 and/orother external sources. For data from tiles 4 on the same chip, theprogram can time any dependent computations relative to the knownexchange timing of the time-deterministic interconnect (to be discussedin more detail later with respect to FIGS. 16 and 17). Note: for thesake of illustration, the above discussion by reference to FIG. 9 hasassumed that every exchange involves an external exchange between atleast some tiles 4 on different chips 2. In the fact the BSP behaviourmay be split into internal and external domains, as will be discussedlater with respect to FIG. 13. Nonetheless, the principle ofsynchronizing to the receipt of external data still applies.

By way of illustration, the following now describes further optionaldetails for implementing the features of the systems of FIG. 21 orsimilar. Further example details of the external exchange mechanism willbe described in relation to FIG. 19 in context of the exampleimplementations of 1 to 18 and 20.

FIG. 1 illustrates an example of a processor module 4 in accordance withembodiments of the present disclosure. For instance the processor module4 may be one tile of an array of like processor tiles on a same chip, ormay be implemented as a stand-alone processor on its own chip. Theprocessor module 4 comprises a multi-threaded processing unit 10 in theform of a barrel-threaded processing unit, and a local memory 11 (i.e.on the same tile in the case of a multi-tile array, or same chip in thecase of a single-processor chip). A barrel-threaded processing unit is atype of multi-threaded processing unit in which the execution time ofthe pipeline is divided into a repeating sequence of interleaved timeslots, each of which can be owned by a given thread. This will bediscussed in more detail shortly. The memory 11 comprises an instructionmemory 12 and a data memory 22 (which may be implemented in differentaddressable memory unit or different regions of the same addressablememory unit). The instruction memory 12 stores machine code to beexecuted by the processing unit 10, whilst the data memory 22 storesboth data to be operated on by the executed code and data output by theexecuted code (e.g. as a result of such operations).

The memory 12 stores a variety of different threads of a program, eachthread comprising a respective sequence of instructions for performing acertain task or tasks. Note that an instruction as referred to hereinmeans a machine code instruction, i.e. an instance of one of thefundamental instructions of the processor's instruction set, consistingof a single opcode and zero or more operands.

The program described herein comprises a plurality of worker threads,and a supervisor subprogram which may be structured as one or moresupervisor threads. These will be discussed in more detail shortly. Inembodiments, each of some or all of the worker threads takes the form ofa respective “codelet”. A codelet is a particular type of thread,sometimes also referred to as an “atomic” thread. It has all the inputinformation it needs to execute from the beginning of the thread (fromthe time of being launched), i.e. it does not take any input from anyother part of the program or from memory after being launched. Further,no other part of the program will use any outputs (results) of thethread until it has terminated (finishes). Unless it encounters anerror, it is guaranteed to finish. N.B. some literature also defines acodelet as being stateless, i.e. if run twice it could not inherit anyinformation from its first run, but that additional definition is notadopted here. Note also that not all of the worker threads need becodelets (atomic), and in embodiments some or all of the workers mayinstead be able to communicate with one another.

Within the processing unit 10, multiple different ones of the threadsfrom the instruction memory 12 can be interleaved through a singleexecution pipeline 13 (though typically only a subset of the totalthreads stored in the instruction memory can be interleaved at any givenpoint in the overall program). The multi-threaded processing unit 10comprises: a plurality of context register files 26 each arranged torepresent the state (context) of a different respective one of thethreads to be executed concurrently; a shared execution pipeline 13 thatis common to the concurrently executed threads; and a scheduler 24 forscheduling the concurrent threads for execution through the sharedpipeline in an interleaved manner, preferably in a round robin manner.The processing unit 10 is connected to a shared instruction memory 12common to the plurality of threads, and a shared data memory 22 that isagain common to the plurality of threads.

The execution pipeline 13 comprises a fetch stage 14, a decode stage 16,and an execution stage 18 comprising an execution unit which may performarithmetic and logical operations, address calculations, load and storeoperations, and other operations, as defined by the instruction setarchitecture. Each of the context register files 26 comprises arespective set of registers for representing the program state of arespective thread.

An example of the registers making up each of the context register files26 is illustrated schematically in FIG. 2. Each of the context registerfiles 26 comprises a respective one or more control registers 28,comprising at least a program counter (PC) for the respective thread(for keeping track of the instruction address at which the thread iscurrently executing), and in embodiments also a set of one or morestatus registers (SR) recording a current status of the respectivethread (such as whether it is currently running or paused, e.g. becauseit has encountered an error). Each of the context register files 26 alsocomprises a respective set of operand registers (OP) 32, for temporarilyholding operands of the instructions executed by the respective thread,i.e. values operated upon or resulting from operations defined by theopcodes of the respective thread's instructions when executed. It willbe appreciated that each of the context register files 26 may optionallycomprise a respective one or more other types of register (not shown).Note also that whilst the term “register file” is sometimes used torefer to a group of registers in a common address space, this does notnecessarily have to be the case in the present disclosure and each ofthe hardware contexts 26 (each of the register sets 26 representing eachcontext) may more generally comprise one or multiple such registerfiles.

In embodiments, the arrangement comprises one worker context registerfile CX0 . . . CX(M−1) for each of the number M of threads that can beexecuted concurrently (M=3 in the example illustrated but this is notlimiting), and one additional supervisor context register file CXS. Theworker context register files are reserved for storing the contexts ofworker threads, and the supervisor context register file is reserved forstoring the context of a supervisor thread. Note that in embodiments thesupervisor context is special, in that it has a different number ofregisters than each of the workers. Each of the worker contextspreferably have the same number of status registers and operandregisters as one another. In embodiments the supervisor context may havefewer operand registers than each of the workers. Examples of operandregisters the worker context may have that the supervisor does notinclude: floating point registers, accumulate registers, and/ordedicated weight registers (for holding weights of a neural network). Inembodiments the supervisor may also have a different number of statusregisters. Further, in embodiments the instruction set architecture ofthe processor module 4 may be configured such that the worker threadsand supervisor thread(s) execute some different types of instruction butalso share some instruction types.

The fetch stage 14 is connected so as to fetch instructions to beexecuted from the instruction memory 12, under control of the scheduler24. The scheduler 24 is configured to control the fetch stage 14 tofetch an instruction from each of a set of concurrently executingthreads in turn in a repeating sequence of time slots, thus dividing theresources of the pipeline 13 into a plurality of temporally interleavedtime slots, as will be discussed in more detail shortly. For example thescheduling scheme could be round-robin or weighted round-robin. Anotherterm for a processor operating in such a manner is a barrel threadedprocessor.

In some embodiments, the scheduler 24 may have access to one of thestatus registers SR of each thread indicating whether the thread ispaused, so that the scheduler 24 in fact controls the fetch stage 14 tofetch the instructions of only those of the threads that are currentlyactive. In embodiments, preferably each time slot (and correspondingcontext register file) is always owned by one thread or another, i.e.each slot is always occupied by some thread, and each slot is alwaysincluded in the sequence of the scheduler 24; though the threadoccupying any given slot may happen to be paused at the time, in whichcase when the sequence comes around to that slot, the instruction fetchfor the respective thread is passed over. Alternatively it is notexcluded for example that in alternative, less preferredimplementations, some slots can be temporarily vacant and excluded fromthe scheduled sequence. Where reference is made to the number of timeslots the execution unit is operable to interleave, or such like, thisrefers to the maximum number of slots the execution unit is capable ofexecuting concurrently, i.e. the number of concurrent slots theexecution unit's hardware supports.

The fetch stage 14 has access to the program counter (PC) of each of thecontexts. For each respective thread, the fetch stage 14 fetches thenext instruction of that thread from the next address in the programmemory 12 as indicated by the program counter. The program counterincrements each execution cycle unless branched by a branch instruction.The fetch stage 14 then passes the fetched instruction to the decodestage 16 to be decoded, and the decode stage 16 then passes anindication of the decoded instruction to the execution unit 18 alongwith the decoded addresses of any operand registers 32 specified in theinstruction, in order for the instruction to be executed. The executionunit 18 has access to the operand registers 32 and the control registers28, which it may use in executing the instruction based on the decodedregister addresses, such as in the case of an arithmetic instruction(e.g. by adding, multiplying, subtracting or dividing the values in twooperand registers and outputting the result to another operand registerof the respective thread). Or if the instruction defines a memory access(load or store), the load/store logic of the execution unit 18 loads avalue from the data memory into an operand register of the respectivethread, or stores a value from an operand register of the respectivethread into the data memory 22, in accordance with the instruction. Orif the instruction defines a branch or a status change, the executionunit changes value in the program counter PC or one of the statusregisters SR accordingly. Note that while one thread's instruction isbeing executed by the execution unit 18, an instruction from the threadin the next time slot in the interleaved sequence can be being decodedby the decode stage 16; and/or while one instruction is being decoded bythe decode stage 16, the instruction from the thread in the next timeslot after that can be being fetched by the fetch stage 14 (though ingeneral the scope of the disclosure is not limited to one instructionper time slot, e.g. in alternative scenarios a batch of two or moreinstructions could be issued from a given thread per time slot). Thusthe interleaving advantageously hides latency in the pipeline 13, inaccordance with known barrel threaded processing techniques.

An example of the interleaving scheme implemented by the scheduler 24 isillustrated in FIG. 3. Here the concurrent threads are interleavedaccording to a round-robin scheme whereby, within each round of thescheme, the round is divided into a sequence of time slots S0, S1, S2 .. . , each for executing a respective thread. Typically each slot is oneprocessor cycle long and the different slots are evenly sized, thoughnot necessarily so in all possible embodiments, e.g. a weightedround-robin scheme is also possible whereby some threads get more cyclesthan others per execution round. In general the barrel-threading mayemploy either an even round-robin or a weighted round-robin schedule,where in the latter case the weighting may be fixed or adaptive.

Whatever the sequence per execution round, this pattern then repeats,each round comprising a respective instance of each of the time slots.Note therefore that a time slot as referred to herein means therepeating allocated place in the sequence, not a particular instance ofthe time slot in a given repetition of the sequence. Put another way,the scheduler 24 apportions the execution cycles of the pipeline 13 intoa plurality of temporally interleaved (time-division multiplexed)execution channels, with each comprising a recurrence of a respectivetime slot in a repeating sequence of time slots. In the illustratedembodiment, there are four time slots, but this is just for illustrativepurposes and other numbers are possible. E.g. in one preferredembodiment there are in fact six time slots.

Whatever the number of time slots the round-robin scheme is dividedinto, then according to present disclosure, the processing unit 10comprises one more context register file 26 than there are time slots,i.e. it supports one more context than the number of interleavedtimeslots it is capable of barrel-threading.

This is illustrated by way of example in FIG. 2: if there are four timeslots S0 . . . S3 as shown in FIG. 3, then there are five contextregister files, labelled here CX0, CX1, CX2, CX3 and CXS. That is, eventhough there are only four execution time slots S0 . . . S3 in thebarrel-threaded scheme and so only four threads can be executedconcurrently, it is disclosed herein to add a fifth context registerfile CXS, comprising a fifth program counter (PC), a fifth set ofoperand registers 32, and in embodiments also a fifth set of one or morestatus registers (SR). Though note that as mentioned, in embodiments thesupervisor context may differ from the others CX0 . . . 3, and thesupervisor thread may support a different set of instructions foroperating the execution pipeline 13.

Each of the first four contexts CX0 . . . CX3 is used to represent thestate of a respective one of a plurality of “worker threads” currentlyassigned to one of the four execution time slots S0 . . . S3, forperforming whatever application-specific computation tasks are desiredby the programmer (note again this may only be subset of the totalnumber of worker threads of the program as stored in the instructionmemory 12). The fifth context CXS however, is reserved for a specialfunction, to represent the state of a “supervisor thread” (SV) whoserole it is to coordinate the execution of the worker threads, at leastin the sense of assigning which of the worker threads W is to beexecuted in which of the time slots S0, S1, S2 . . . at what point inthe overall program. Optionally the supervisor thread may have other“overseer” or coordinating responsibilities. For example, the supervisorthread may be responsible for performing barrier synchronisations toensure a certain order of execution. E.g. in a case where one or moresecond threads are dependent on data to be output by one or more firstthreads run on the same processor module 4, the supervisor may perform abarrier synchronization to ensure that none of the second threads beginsuntil the first threads have finished. And/or, the supervisor mayperform a barrier synchronization to ensure that one or more threads onthe processor module 4 do not begin until a certain external source ofdata, such as another tile or processor chip, has completed theprocessing required to make that data available. The supervisor threadmay also be used to perform other functionality relating to the multipleworker threads. For example, the supervisor thread may be responsiblefor communicating data externally to the processor module 4 (to receiveexternal data to be acted on by one or more of the threads, and/or totransmit data output by one or more of the worker threads). In generalthe supervisor thread may be used to provide any kind of overseeing orcoordinating function desired by the programmer. For instance as anotherexample, the supervisor may oversee transfer between the tile localmemory 12 and one or more resources in the wider system (external to thearray 6) such as a storage disk or network card.

Note of course that four time slots is just an example, and generally inother embodiments there may be other numbers, such that if there are amaximum of M time slots 0 . . . M−1 per round, the processor module 4comprises M+1 contexts CX . . . CX(M−1) & CXS, i.e. one for each workerthread that can be interleaved at any given time and an extra contextfor the supervisor. E.g. in one exemplary implementation there are sixtimeslots and seven contexts.

Referring to FIG. 4, the supervisor thread SV does not have its own timeslot per se in the scheme of interleaved time slots. Nor do the workersas allocation of slots to worker threads is flexibly defined. Rather,each time slot has its own dedicated context register file (CX0 . . .CXM−1) for storing worker context, which is used by the worker when theslot is allocated to the worker, but not used when the slot is allocatedto the supervisor. When a given slot is allocated to the supervisor,that slot instead uses the context register file CXS of the supervisor.Note that the supervisor always has access to its own context and noworkers are able to occupy the supervisor context register file CXS.

The supervisor thread SV has the ability to run in any and all of thetime slots S0 . . . S3 (or more generally S0 . . . SM−1). The scheduler24 is configured so as, when the program as a whole starts, to begin byallocating the supervisor thread to all of the time slots, i.e. so thesupervisor SV starts out running in all of S0 . . . S3. However, thesupervisor thread is provided with a mechanism for, at some subsequentpoint (either straight away or after performing one or more supervisortasks), temporarily relinquishing each of the slots in which it isrunning to a respective one of the worker threads, e.g. initiallyworkers W0 . . . W3 in the example shown in FIG. 4. This is achieved bythe supervisor thread executing a run instruction, called “RUN” by wayof example herein. In embodiments this instruction takes two operands:an address of a worker thread in the instruction memory 12 and anaddress of some data for that worker thread in the data memory 22:

RUN task_addr, data_addr

The worker threads are portions of code that can be run concurrentlywith one another, each representing one or more respective computationtasks to be performed. The data address may specify some data to beacted upon by the worker thread. Alternatively, the run instruction maytake only a single operand specifying the address of the worker thread,and the data address could be included in the code of the worker thread;or in another example the single operand could point to a data structurespecifying the addresses of the worker thread and data. As mentioned, inembodiments at least some of the workers may take the form of codelets,i.e. atomic units of concurrently executable code. Alternatively oradditionally, some of the workers need not be codelets and may insteadbe able to communicate with one another.

The run instruction (“RUN”) acts on the scheduler 24 so as to relinquishthe current time slot, in which this instruction is itself executed, tothe worker thread specified by the operand. Note that it is implicit inthe run instruction that it is the time slot in which this instructionis executed that is being relinquished (implicit in the context ofmachine code instructions means it doesn't need an operand to specifythis—it is understood implicitly from the opcode itself). Thus the timeslot which is given away is the time slot in which the supervisorexecutes the run instruction. Or put another way, the supervisor isexecuting in the same space that that it gives away. The supervisor says“run this piece of code at this location”, and then from that pointonwards the recurring slot is owned (temporarily) by the relevant workerthread.

The supervisor thread SV performs a similar operation in each of one ormore others of the time slots, to give away some or all of its timeslots to different respective ones of the worker threads W0 . . . W3(selected from a larger set W0 . . . Wj in the instruction memory 12).Once it has done so for the last slot, the supervisor is suspended (thenlater will resume where it left off when one of the slots is handed backby a worker W).

The supervisor thread SV is thus able to allocate different workerthreads, each performing one or more tasks, to different ones of theinterleaved execution time slots S0 . . . S3. When the supervisor threaddetermines it is time to run a worker thread, it uses the runinstruction (“RUN”) to allocate this worker to the time slot in whichthe RUN instruction was executed.

In some embodiments, the instruction set also comprises a variant of therun instruction, RUNALL (“run all”). This instruction is used to launcha set of more than one worker together, all executing the same code. Inembodiments this launches a worker in every one of the processing unit'sslots S0 . . . S3 (or more generally S0 . . . S(M−1)).

Further, in some embodiments the RUN and/or RUNALL instruction, whenexecuted, also automatically copies some status from one or more of thesupervisor status registers CXS(SR) to a corresponding one or morestatus registers of the worker thread(s) launched by the RUN or RUNALL.For instance the copied status may comprise one or more modes, such as afloating point rounding mode (e.g. round to nearest or round to zero)and/or an overflow mode (e.g. saturate or use a separate valuerepresenting infinity). The copied status or mode then controls theworker in question to operate in accordance with the copied status ormode. In embodiments, the worker can later overwrite this in its ownstatus register (but cannot change the supervisor's status). In furtheralternative or additional embodiments, the workers can choose to readsome status from one or more status registers of the supervisor (andagain may change their own status later). E.g. again this could be toadopt a mode from the supervisor status register, such as a floatingpoint mode or a rounding mode. In embodiments however, the supervisorcannot read any of the context registers CX0 . . . of the workers.

Each of the currently allocated worker threads W0 . . . W3 proceeds toperform the one or more computation tasks defined in the code specifiedby the respective run instruction. At the end of this, the respectiveworker thread then hands the time slot in which it is running back tothe supervisor thread. This is achieved by executing an exit instruction(“EXIT”).

The EXIT instruction takes at least one operand and preferably only asingle operand, exit_state (e.g. a binary value), to be used for anypurpose desired by the programmer to indicate a state of the respectivecodelet upon ending (e.g. to indicate whether a certain condition wasmet):

EXIT exit_state

The EXIT instruction acts on the scheduler 24 so that the time slot inwhich it is executed is returned back to the supervisor thread. Thesupervisor thread can then perform one or more subsequent supervisortasks (e.g. barrier synchronization and/or exchange of data withexternal resources such as other tiles), and/or continue to executeanother run instruction to allocate a new worker thread (W4, etc.) tothe slot in question. Note again therefore that the total number ofthreads in the instruction memory 12 may be greater than the number thatbarrel-threaded processing unit 10 can interleave at any one time. It isthe role of the supervisor thread SV to schedule which of the workerthreads W0 . . . Wj from the instruction memory 12, at which stage inthe overall program, are to be assigned to which of the interleaved timeslots S0 . . . SM in the round robin schedule of the scheduler 24.

Furthermore, in embodiments the EXIT instruction may have a furtherspecial function, namely to cause the exit state specified in theoperand of the EXIT instruction to be automatically aggregated (bydedicated hardware logic 37) with the exit states of a plurality ofother worker threads being run through the same pipeline 13 of the sameprocessor module 4 (e.g. same tile). Thus an extra, implicit facility isincluded in the instruction for terminating a worker thread.

An example circuit for achieving this is shown in FIG. 5. In thisexample, the exit states of the individual threads and the aggregatedexit state each take the form of a single bit, i.e. 0 or 1. Theprocessor module 4 comprises a “local consensus” ($LC) register 38 forstoring the aggregated exit state of that processor module 4. Inembodiments this local consensus register $LC 38 is one of thesupervisor's status registers in the supervisor's context register fileCXS. The logic for performing the aggregation may comprise an AND gate37 arranged to perform a logical AND of (A) the exit state specified inthe EXIT instructions' operand and (B) the current value in the localconsensus register ($LC) 38, and to output the result (Q) back into thelocal consensus register $LC 38 as a new value of the local aggregate.However it will be appreciated that FIG. 5 is just one example and otherforms of automated aggregation could be implemented, such as a BooleanOR (equivalent if the interpretation of 0 and 1 are inverted), or morecomplex circuitry for aggregating non-Booleans exit states. E.g. inembodiments the exit states may be trinary states.

At a suitable synchronization point in the program, the value stored inthe local consensus register ($LC) 38 is initially reset to a valueof 1. I.e. any threads exiting after this point will contribute to thelocally aggregated exit state $LC until next reset. Every time an EXITinstruction is executed its exit state is aggregated with those thathave gone before (since last reset). Thus by means of the arrangementshown in FIG. 5, the logic keeps a running aggregate of the exit statesof any worker threads which have terminated by means of an EXITinstruction since the last time the local consensus register ($LC) 38was reset. The reset of the aggregate in the local consensus register($LC) 38 may be performed by the supervisor SV performing a PUT to theregister address of the local consensus register ($LC) 38 using one ormore general purpose instructions. Alternatively it is not excluded thatthe reset could be performed by an automated mechanism, for exampletriggered by executing the SYNC instruction described later herein.

The exit states can be used to represent whatever the programmer wishes,but one particularly envisaged example is to use an exit state of 1 toindicate that the respective worker thread has exited in a “successful”or “true” state, whilst an exit state of 0 indicates the respectiveworker thread exited in an “unsuccessful” or “false” state. E.g. theexit state of a thread may represent whether the error(s) in the one ormore parameters of a respective node in the graph of a machineintelligence algorithm has/have fallen within an acceptable levelaccording to a predetermined metric; or in a non-Boolean case, a degreeof confidence in the result of the thread.

Whatever meaning is given by the programmer to the exit states, thesupervisor thread SV can then get the aggregated value from the localconsensus register ($LC) 38 to determine the aggregated exit state ofall the worker threads that exited since it was last reset, for exampleat the last synchronization point, e.g. to determine whether or not allthe workers exited in a successful or true state. In dependence on thisaggregated value, the supervisor thread may then make a decision inaccordance with the programmer's design; such as to report to the hostprocessor 93H, or perform another iteration of the part of the programcomprising the same worker threads.

Referring to FIG. 6, in embodiments a SYNC (synchronization) instructionis provided in the processor's instruction set. The SYNC instruction hasthe effect of causing the supervisor thread SV to wait until allcurrently executing workers W have exited by means of an EXITinstruction. In embodiments the SYNC instruction takes a mode as anoperand (in embodiments its only operand), the mode specifying whetherthe SYNC is to act only locally in relation to only those worker threadsrunning locally on the same processor module 4, e.g. same tile, as thesupervisor as part of which the SYNC is executed on (i.e. only threadsthrough the same pipeline 13 of the same barrel-threaded processing unit10); or whether instead it is to apply across multiple tiles or evenacross multiple chips.

SYNC mode // mode ∈ {tile, chip, zone_1, zone_2}

This will be discussed in more detail later but for the purposes of FIG.6 a local SYNC will be assumed (“SYNC tile”, i.e. a synchronizationwithin a single tile).

The workers do not need to be identified as operands of the SYNCinstruction, as it is implicit that the supervisor SV is then caused toautomatically wait until none of the time slots S0, S1, . . . of thebarrel-threaded processing unit 10 is occupied by a worker. As shown inFIG. 6, once each of a current batch of workers WLn have all beenlaunched by the supervisor, the supervisor then executes a SYNCinstruction. If the supervisor SV launches workers W in all the slots S0. . . 3 of the barrel-threaded processing unit 10 (all four in theexample illustrated, but that is just one example implementation), thenthe SYNC will be executed by the supervisor once the first of thecurrent batch of worker threads WLn has exited, thus handing backcontrol of at least one slot to the supervisor SV. Otherwise if theworkers do not take up all of the slots, the SYNC will simply beexecuted immediately after the last thread of the current batch WLn hasbeen launched. Either way, the SYNC causes the supervisor SV to wait forall others of the current batch of workers WLn−1 to execute an EXITbefore the supervisor can proceed. Only after this the supervisorexecutes a GET instruction to get the content of the local consensusregister ($LC) 38. This waiting by the supervisor thread is imposed inhardware once the SYNC has been executed. I.e. in response to the opcodeof the SYNC instruction, the logic in the execution unit (EXU) of theexecution stage 18 causes the fetch stage 14 and scheduler 24 to pausefrom issuing instructions of the supervisor thread until all outstandingworker threads have executed an EXIT instruction. At some point aftergetting the value of the local consensus register ($LC) 38 (optionallywith some other supervisor code in between), the supervisor executes aPUT instruction to reset the local consensus register ($LC) 38 (in theillustrated example to 1).

As also illustrated in FIG. 6, the SYNC instruction may also be used toplace synchronization barriers between different interdependent layersWL1, WL2, WL3, . . . of worker threads, where one or more threads ineach successive layer is dependent on data output by one or more workerthreads in its preceding layer. The local SYNC executed by thesupervisor thread ensures that none of the worker threads in the nextlayer WLn+1 executes until all the worker threads in the immediatelypreceding layer WLn have exited (by executing an EXIT instruction).

As mentioned, in embodiments the processor module 4 may be implementedas one of an array of interconnected tiles forming a multi-tileprocessor, wherein each of tile may be configured as described above inrelation to FIGS. 1 to 6.

This is illustrated further in FIG. 7 which shows a single chipprocessor 2, i.e. a single die, comprising an array 6 of multipleprocessor tiles 4 and an on-chip interconnect 34 connecting between thetiles 4. The chip 2 may be implemented alone on its own single-chipintegrated circuit package, or as one of multiple dies packaged in thesame IC package. The on-chip interconnect may also be referred to hereinas the “exchange fabric” 34 as it enables the tiles 4 to exchange datawith one another. Each tile 4 comprises a respective instance of thebarrel-threaded processing unit 10 and memory 11, each arranged asdescribed above in relation to FIGS. 1 to 6. For instance, by way ofillustration the chip 2 may comprise of the order of hundreds of tiles4, or even over a thousand. For completeness, note also that an “array”as referred to herein does not necessarily imply any particular numberof dimensions or physical layout of the tiles 4.

In embodiments each chip 2 also comprises one or more external links 8,enabling the chip-2 to be connected to one or more other, externalprocessors on different chips (e.g. one or more other instances of thesame chip 2). These external links 8 may comprise any one or more of:one or more chip-to-host links for connecting the chip 2 to a hostprocessor, and/or one or more chip-to-chip links for connecting togetherwith one or more other instances of the chip 2 on the same IC package orcard, or on different cards. In one example arrangement, the chip 2receives work from a host processor (not shown) which is connected tothe chip via one of the chip-to-host links in the form of input data tobe processed by the chip 2. Multiple instances of the chip 2 can beconnected together into cards by chip-to-chip links. Thus a host mayaccess a computer which is architected as a single chip processor 2 oras multiple single chip processors 2 possibly arranged on multipleinterconnected cards, depending on the workload required for the hostapplication.

The interconnect 34 is configured to enable the different processortiles 4 in the array 6 to communicate with one another on-chip 2.However, as well as there potentially being dependencies between threadson the same tile 4, there may also be dependencies between the portionsof the program running on different tiles 4 in the array 6. A techniqueis therefore required to prevent a piece of code on one tile 4 runningahead of data upon which it is dependent being made available by anotherpiece of code on another tile 4.

This may be achieved by implementing a bulk synchronous parallel (BSP)exchange scheme, as illustrated schematically in FIGS. 8 and 9.

According to one version of BSP, each tile 4 performs a compute phase 52and an exchange phase 50 in an alternating cycle, separated from one tothe other by a barrier synchronization 30 between tiles. In the caseillustrated a barrier synchronization is placed between each computephase 52 and the following exchange phase 50. During the compute phase52 each tile 4 performs one or more computation tasks locally on-tile,but does not communicate any results of these computations with anyothers of the tiles 4. In the exchange phase 50 each tile 4 is allowedto exchange one or more results of the computations from the precedingcompute phase to and/or from one or more others of the tiles in thegroup, but does not perform any new computations until it has receivedfrom other tiles 4 any data on which its task(s) has/have dependency.Neither does it send to any other tile any data except that computed inthe preceding compute phase. It is not excluded that other operationssuch as internal control-related operations may be performed in theexchange phase. In embodiments the exchange phase 50 does not includeany non-time-deterministic computations, but a small number oftime-deterministic computations may optionally be allowed during theexchange phase 50. Note also that a tile 4 performing computation may beallowed during the compute phase 52 to communicate with other externalsystem resources external to the array of tiles 4 beingsynchronized—e.g. a network card, disk drive, or field programmable gatearray (FPGA)—as long as this does not involve communication with othertiles 4 within the group being synchronized. The communication externalto the tile group may optionally utilise the BSP mechanism, butalternatively may not utilize BSP and may instead use some othersynchronization mechanism of its own.

According to the BSP principle, a barrier synchronization 30 is placedat the juncture transitioning from the compute phases 52 into theexchange phase 50, or the juncture transitioning from the exchangephases 50 into the compute phase 52, or both. That is to say, either:(a) all tiles 4 are required to complete their respective compute phases52 before any in the group is allowed to proceed to the next exchangephase 50, or (b) all tiles 4 in the group are required to complete theirrespective exchange phases 50 before any tile in the group is allowed toproceed to the next compute phase 52, or (c) both of these conditions isenforced. In all three variants it is the individual processors whichalternate between phases, and the whole assembly which synchronizes. Thesequence of exchange and compute phases may then repeat over multiplerepetitions. In BSP terminology, each repetition of exchange phase andcompute phase is sometimes referred to as a “superstep” (though notethat in the literature the terminology is not always used consistently:sometimes each individual exchange phase and compute phase individuallyis called a superstep, whereas elsewhere, as in the terminology adoptedherein, the exchange and compute phases together are referred to as asuperstep).

Note also, it is not excluded that multiple different independent groupsof tiles 4 on the same chip 2 or different chips could each form aseparate respective BSP group operating asynchronously with respect toone another, with the BSP cycle of compute, synchronize and exchangebeing imposed only within each given group, but each group doing soindependently of the other groups. I.e. a multi-tile array 6 mightinclude multiple internally synchronous groups each operatingindependently and asynchronously to the other such groups (discussed inmore detail later). In some embodiments there is a hierarchical groupingof sync and exchange, as will be discussed in more detail later.

FIG. 9 illustrates the BSP principle as implemented amongst a group 4 i,4 ii, 4 iii of some or all of the tiles in the array 6, in the casewhich imposes: (a) a barrier synchronization from compute phase 52 toexchange phase 50 (see above). Note that in this arrangement, some tiles4 are allowed to begin computing 52 whilst some others are stillexchanging.

According to embodiments disclosed herein, this type of BSP may befacilitated by incorporating additional, special, dedicatedfunctionality into a machine code instruction for performing barriersynchronization, i.e. the SYNC instruction.

In embodiments, the SYNC function takes this functionality whenqualified by an inter-tile mode as an operand, e.g. the on-chip mode:SYNC chip.

This is illustrated schematically in FIG. 10. In the case where eachtile 4 comprises a multi-threaded processing unit 10, then each tile'scompute phase 52 may in fact comprise tasks performed by multiple workerthreads W on the same tile 4 (and a given compute phase 52 on a giventile 4 may comprise one or more layers WL of worker threads, which inthe case of multiple layers may be separated by internal barriersynchronizations using the SYNC instruction with the local on-tile modeas an operand, as described previously). Once the supervisor thread SVon a given tile 4 has launched the last worker thread in the current BSPsuperstep, the supervisor on that tile 4 then executes a SYNCinstruction with the inter-tile mode set as the operand: SYNC chip. Ifthe supervisor is to launch (RUN) worker threads in all the slots of itsrespective processing unit 10, the “SYNC chip” is executed as soon asthe first slot that is no longer needed to RUN any more workers in thecurrent BSP superstep is handed back to the supervisor. E.g. this mayoccur after the first thread to EXIT in the last layer WL, or simplyafter the first worker thread to EXIT if there is only a single layer.

Otherwise if not all the slots are to be used for running workers in thecurrent BSP superstep, the “SYNC chip” can be executed as soon as thelast worker that needs to be RUN in the current BSP superstep has beenlaunched. This may occur once all the workers in the last layer havebeen RUN, or simply once all the worker threads have been RUN if thereis only one layer.

The execution unit (EXU) of the execution stage 18 is configured so as,in response to the opcode of the SYNC instruction, when qualified by theon-chip (inter-tile) operand, to cause the supervisor thread in whichthe “SYNC chip” was executed to be paused until all the tiles 4 in thearray 6 have finished running workers. This can be used to implement abarrier to the next BSP superstep. I.e. after all tiles 4 on the chip 2have passed the barrier, the cross-tile program as a whole can progressto the next exchange phase 50.

FIG. 11 gives a schematic diagram illustrating the logic trigged by a“SYNC chip” according to embodiments disclosed herein.

Once the supervisor has launched (RUN) all of the threads it intends toin the current compute phase 52, it then executes a SYNC instructionwith the on-chip, inter-tile operand: SYNC chip. This triggers thefollowing functionality to be triggered in dedicated synchronizationlogic 39 on the tile 4, and in a synchronization controller 36implemented in the hardware interconnect 34. This functionality of boththe on-tile sync logic 39 and the synchronization controller 36 in theinterconnect 34 is implemented in dedicated hardware circuitry suchthat, once the SYNC chip is executed, the rest of the functionalityproceeds without further instructions being executed to do so.

Firstly, the on-tile sync logic 39 causes the instruction issue for thesupervisor on the tile 4 in question to automatically pause (causes thefetch stage 14 and scheduler 24 to suspend issuing instructions of thesupervisor). Once all the outstanding worker threads on the local tile 4have performed an EXIT, then the sync logic 39 automatically sends asynchronization request “sync_req” to the synchronization controller 36in the interconnect 34. The local tile 4 then continues to wait with thesupervisor instruction issue paused. A similar process is alsoimplemented on each of the other tiles 4 in the array 6 (each comprisingits own instance of the sync logic 39). Thus at some point, once all thefinal workers in the current compute phase 52 have EXITed on all thetiles 4 in the array 6, the synchronization controller 36 will havereceived a respective synchronization request (sync_req) from all thetiles 4 in the array 6. Only then, in response to receiving the sync_reqfrom every tile 4 in the array 6 on the same chip 2, the synchronizationcontroller 36 sends a synchronization acknowledgement signal “sync_ack”back to the sync logic 39 on each of the tiles 4. Up until this point,each of the tiles 4 has had its supervisor instruction issue pausedwaiting for the synchronization acknowledgment signal (sync_ack). Uponreceiving the sync_ack signal, the sync logic 39 in the tile 4automatically unpauses the supervisor instruction issue for therespective supervisor thread on that tile 4. The supervisor is then freeto proceed with exchanging data with other tiles 4 via the interconnect34 in a subsequent exchange phase 50.

Preferably the sync_req and sync_ack signals are transmitted andreceived to and from the synchronization controller, respectively, viaone or more dedicated sync wires connecting each tile 4 to thesynchronization controller 36 in the interconnect 34.

Furthermore, in embodiments, an additional functionality may be includedin the SYNC instruction. That is, at least when executed in aninter-tile mode (e.g. SYNC chip), the SYNC instruction also causes thelocal exit states $LC of each of the synchronized tiles 4 to beautomatically aggregated by further dedicated hardware 40 in theinterconnect 34. In the embodiment shown this logic 40 takes the AND ofthe local exits states. However, this is just one example, and in otherembodiments the global aggregation logic 40 could e.g. take the BooleanOR, or a more complex combination of non-Boolean exit states.

In response to the synchronization request (sync_req) being receivedfrom all of the tiles 4 in the array 6, the synchronization controller36 causes the output of the global aggregation logic 40 to be stored ina global consensus register ($GC) 42 on each tile 4. This register $GC42 is accessible by the supervisor thread SV on the respective tile 4once the supervisor instruction issue is resumed. In embodiments theglobal consensus register $GC is implemented as a control register inthe supervisor's control register file CXS, 28 such that the supervisorthread can get the value in the global consensus register ($GC) 42 bymeans of a GET instruction.

The globally aggregated exit state $GC enables the program to determinean overall outcome of parts of the program running on multiple differenttiles 4 without having to individually examine the state of eachindividual worker thread on each individual tile. It can be used for anypurpose desired by the programmer, e.g. to determine whether or not theparts of the code running on all the tiles have all satisfied apredetermined condition, or an overall degree of confidence in theresults of the tiles. In one example use case, the supervisor on one ormore of the tiles may report to the host processor 93H if the globalaggregate indicated a false or unsuccessful outcome. As another example,the program may perform a branch decision depending on the global exitstate.

As mentioned previously, in embodiments multiple instances of the chip 2can be connected together to form an even larger array of tiles 4spanning multiple chips 2. This is illustrated in FIG. 12. Some or allof the chips 2 may be implemented on the same IC package or some or allof the chips 2 may be implemented on different IC packages. The chips 2are connected together by an external interconnect 72 (via the externallinks 8 shown in FIG. 7). This may connect between chips 2 on the sameIC package, different IC packages on the same card, and/or different ICpackages on different cards. As well as providing a conduit for exchangeof data between tiles 4 on different chips, the external interconnect 72also provides hardware support for performing barrier synchronizationbetween the tiles 4 on different chips 2 and aggregating the local exitstates of the tiles 4 on the different chips 2.

In embodiments, the SYNC instruction can take at least one furtherpossible value of its mode operand to specify an external, i.e.inter-chip, synchronization: SYNC zone_n, wherein zone_n represents anexternal sync zone. The external interconnect 72 comprises similarhardware logic to that described in relation to FIG. 11, but on anexternal, inter-chip scale. When the SYNC instruction is executed withan external sync zone of two or more chips 2 specified in its operand,this causes the logic in the external interconnect 72 to operate in asimilar manner to that described in relation to the internalinterconnect 34, but across the tiles 4 on the multiple different chips2 in the specified sync zone.

That is, in response to the opcode of the SYNC instruction whose operandspecifies an external sync, the execution stage 18 causes the sync levelspecified by the operand to be signalled to dedicated hardware synclogic 76 in the external interconnect 72. In response to this, the synclogic 76 in the external interconnect conducts the process ofsynchronisation request (sync_req) and acknowledgment (sync_ack) to beperformed only amongst all the external tiles 4 to which, e.g. all thetiles across all chips 2 in the system for a global sync. I.e. the synclogic 76 in the external interconnect 72 will return the syncacknowledgment signal (sync_ack) to the tiles 4 across chips 2 only oncea synchronization request (sync_req) has been received from all thetiles 4 from those chips. All the tiles 4 on all those chips 2 will beautomatically paused until the sync acknowledgment (sync_ack) from theexternal sync logic 76 is returned.

Thus, in response to an external SYNC, the supervisor instruction issueis paused until all tiles 4 on all chips 2 in the external sync zonehave completed their compute phase 52 and submitted a sync request.Further, logic in the external interconnect 72 aggregates the local exitstates of all these tiles 4, across the multiple chips 2 in the zone inquestion. Once all tiles 4 in the external sync zone have made the syncrequest, the external interconnect 72 signals a sync acknowledgment backto the tiles 4 and stores the cross-chip global aggregate exit stateinto the global consensus registers ($GC) 42 of all the tiles 4 inquestion. In response to the sync acknowledgement, the tiles 4 on allthe chips 2 in the zone resume instruction issue for the supervisor.

Note that in embodiments the functionality of the interconnect 72 may beimplemented in the chips 2, i.e. the logic may be distributed among thechips 2 such that only wired connections between chips are required(FIGS. 11 and 12 are schematic).

All tiles 4 within the mentioned sync zone are programmed to indicatethe same sync zone via the mode operand of their respective SYNCinstructions. In embodiments the sync logic 76 in the externalinterconnect 72 peripheral is configured such that, if this is not thecase due to a programming error or other error (such as a memory parityerror), then some or all tiles 4 will not receive an acknowledgement,and therefore that the system will come to a halt at the next externalbarrier, thus allowing a managing external CPU (e.g. the host) tointervene for debug or system recovery. Preferably however the compileris configured to ensure the tiles in the same zone all indicate thesame, correct sync zone at the relevant time. The sync logic may also beconfigured to take other alternative or additional measures in event ofinconsistency in the modes indicated by the different SYNC instruction,e.g. raising an exception to the external CPU, and/or halting executionby some other mechanism.

As illustrated in FIG. 14, in embodiments the mode of the SYNCinstruction can be used to specify one of multiple different possibleexternal sync zones, e.g. zone_1 or zone_2. In embodiments thesecorrespond to different hierarchical levels. That is to say, each higherhierarchical level 92 (e.g. zone 2) encompasses two or more zones 91A,91B of at least one lower hierarchical level. In embodiments there arejust two hierarchical levels, but higher numbers of nested levels arenot excluded. If the operand of the SYNC instruction is set to the lowerhierarchical level of external sync zone (SYNC zone_1), then theabove-described sync and aggregation operations are performed inrelation to the tiles 4 on the chips 2 in only the same lower-levelexternal sync zone as the tile on which the SYNC was executed. If on theother hand the operand of the SYNC instruction is set to the higherhierarchical level of external sync zone (SYNC zone_2), then theabove-described sync and aggregation operations are automaticallyperformed in relation to all the tiles 4 on all the chips 2 in the samehigher-level external sync zone as the tile on which the SYNC wasexecuted.

In response to the opcode of the SYNC instruction having an externalsync zone as an operand, the execution stage 18 causes the sync levelspecified by the operand to be signalled to dedicated hardware synclogic 76 in the external interconnect 72. In response to this, the synclogic 76 in the external interconnect conducts the process ofsynchronisation request (sync_req) and acknowledgment (sync_ack) to beperformed only amongst the tiles 4 of the signalled group. I.e. the synclogic 76 in the external interconnect 72 will return the syncacknowledgment signal (sync_ack) to the tiles in the signalled sync zoneonly once a synchronization request (sync_req) has been received fromall the tiles 4 in that zone (but will not wait for any other tilesoutside that zone if it is not a global sync).

Note that in other embodiments, the sync zones that can be specified bythe mode of the SYNC instruction are not limited to being hierarchicalin nature. In general, a SYNC instruction may be provided with modescorresponding to any kind of grouping. For instance, the modes mayenable selection from amongst only non-hierarchical groups, or a mixtureof hierarchical groupings and one or more non-hierarchical groups (whereat least one group is not entirely nested within another). Thisadvantageously enables the flexibility for the programmer or compiler,with minimal code density, to select between different layouts ofinternally-synchronous groups that are asynchronous with respect to oneanother.

An example mechanism for implementing the synchronization amongst theselected sync group 91, 92 is illustrated in FIG. 18. As illustrated,the external sync logic 76 in the external interconnect 72 comprises arespective sync block 95 associated with each respective chip 2. Eachsync block 95 comprises respective gating logic and a respective syncaggregator. The gating logic comprises hardware circuitry which connectstogether the chips 2 in a daisy chain topology for the purpose ofsynchronization and exit state aggregation, and which propagates thesync and exit state information in accordance with the following. Thesync aggregator comprises hardware circuitry configured to aggregate thesynchronization requests (sync_req) and the exit states in accordancewith the following.

The respective sync block 95 associated with each chip 2 is connected toits respective chip 2, such that it can detect the sync request(Sync_req) raised by that chip 2 and the exit state of that chip 2, andso that it can return the sync acknowledgment (Sync_ack) and global exitstate to the respective chip 2. The respective sync block 95 associatedwith each chip 2 is also connected to the sync block 95 of at least oneother of the chips 2 via a sync interface comprising one or more syncwires 96 (part of the sync network). Some of the chips' sync blocks 95are connected to that of two adjacent chips 2, each connection via arespective instance of the sync interface 96. This way, the chips 2 canbe connected in one or more daisy chains via their sync blocks 95. Thisenables the sync requests, sync acknowledgments, running aggregates ofexit states, and global exit states, to be propagated up and down thechain.

In operation, for each sync group 91, 92, the sync block 95 associatedwith one of the chips 2 in that group is set as the master forsynchronization and exit state aggregation purposes, the rest in thegroup being slaves for this purpose. Each of the slave sync blocks 95 isconfigured with the direction (e.g. left or right) that it needs topropagate sync requests, sync acknowledgments and exit states for eachsync group 91, 92 (i.e. the direction toward the master). In embodimentsthese settings are configurable by software, e.g. in an initialconfiguration phase after which the configuration remains set throughoutthe subsequent operation of the system. For instance this may beconfigured by the host processor. Alternatively it is not excluded thatthe configuration could be hard-wired. Either way, the different syncgroups 91, 92 can have different masters and in general it is possiblefor a given chip 2 (or rather its sync block 95) to be master of onegroup and not another group of which it is a member, or to be master ofmultiple groups.

For instance, by way of illustration consider the example scenario ofFIG. 18. Say for the sake of example that the sync block 95 of chip 2IVis set as the master of a given sync group 91A. Consider now the firstchip 2I in the chain of chips 2, connected via their sync blocks 95 andinterface 96 ultimately to chip 2IV. When all the worker threads of thecurrent compute phase on the first chip 2I have executed an EXITinstruction, and the supervisors on all the (participating) tiles 4 haveall executed a SYNC instruction specifying the sync group 91A, then thefirst chip 2I signals its sync readiness to its respective associatedsync block 95. The chip 2I also outputs to its respective sync block 95its chip-level aggregated exit state (the aggregate of all the exitingworkers on all the participating tiles on the respective chip 2I). Inresponse, the sync block 95 of the first chip 2I propagates a syncrequest (Sync_req) to the sync block 95 of the next chip 2II in thechain. It also propagates the exit state of the first chip 2I to thesync block 95 of this next chip 2II. The sync block 95 of this secondchip 2II waits until the supervisors of its own (participating) tiles 4have all executed a SYNC instruction specifying the sync group 91A,causing the second chip 2II to signal sync readiness. Only then does thesecond chip's sync block 95 propagate a sync request to the sync block95 of the next (third) chip 2III in the chain, and also propagates arunning aggregate of the exit state of the first chip 2I with that ofthe second 2II. If the second chip 2II had become sync ready before thefirst 2I, then the sync block 95 of the second chip 2II would havewaited for the first chip 2I to signal a sync request before propagatingthe sync request to the sync block 95 of the third chip 2III. The syncblock 95 of the third chip 2III behaves in a similar manner, this timeaggregating the running aggregate exit state from the second chip 2II toobtain the next running aggregate to pass onwards, etc. This continuestoward the master sync block, that of chip 2IV in this example.

The sync block 95 of the master then determines a global aggregate ofall the exit states based on the running aggregate it receives and theexit state of its own chip 2IV. It propagates this global aggregate backout along the chain to all the chips 2, along with the syncacknowledgement (Sync_ack).

If the master is part way along a chain, as opposed to being at one endas in the above example, then the sync and exit state informationpropagates in opposite directions either side of the master, both sidestoward the master. In this case the master only issues the syncacknowledgment and global exit state once the sync request from bothsides has been received. E.g. consider the case where chip 2III ismaster of group 92. Further, in embodiments the sync block 95 of some ofthe chips 2 could connect to that of three or more other chips 2, thuscreating multiple branches of chains toward the master. Each chain thenbehaves as described above, and the master only issues the syncacknowledgment and global exit state once the sync request from allchains has been received. And/or, one or more of the chips 2 couldconnect to an external resource such as the host processor, a networkcard, a storage device or an FPGA.

Note that the above is only the mechanism for propagating sync and exitstate information. The actual data (content) is transmitted by anotherchannel, for example as discussed later with reference to FIG. 19.Further, it will be appreciated that this is only one exampleimplementation, and the skilled person will be capable of building othercircuits for implementing the disclosed synchronization and aggregationfunctionality once given the specification of that functionalitydisclosed herein.

Regardless of the particular mechanism for signalling sync and exitstate information, in embodiments there is provided a mechanism forenabling a host processor or subsystem 93 to communicate with any workaccelerator sub-system that operates with either a single point ofrendezvous for all its participants (such as BSP), or in someembodiments a sufficiently small number of points of rendezvous (such asa number of independent BSP accelerators all connected to one host) suchthat implementation of a host-processor friendly synchronisationmechanism can be implemented in hardware in a particularly efficientmanner. This situation may contrasted with a traditional CSP approach inwhich the number of points of rendezvous is application specific andthus the synchronization mechanisms such as semaphores must be softwaredefined and thus subject to inefficiencies that follow from this (e.g.processor interrupt latency).

The host 93 here may represent a host processor or CPU 93H, e.g. asdescribed in relation to FIG. 21; or a gateway processor of a wider hostsubsystem.

As shown in FIG. 18 (and referring also to FIG. 12), the overall systemcomprises at least one host processor 93, and an external host interface97 for connecting the host processor 93 to the external interconnect 72(including to the external sync logic 76). For example in embodimentsthe host interface 97 may take the form of a PCI interface. The synclogic 76 of the external interconnect 72 further comprises at least one“host sync proxy” (HSP) module 98. The HSP module 98 is connectedbetween the interface 97 and one of the sync blocks 95. The HSP module98 is arranged to act as a proxy on behalf of the host 93 forsynchronization purposes, to enable the host processor 93 to participatein the synchronization amongst at least one of the sync zones or groups91, 92, as will be discussed in more detail shortly.

In embodiments one HSP module 98 is provided per chip 2 and percorresponding sync block 95. In this case, whichever sync block 95 isconfigured as the master of a given sync group 91, 92, the HSP 98 ofthat sync block is set as the proxy of the host 93 within the group andthe other HSPs are disabled. Thus as with the sync blocks 95, the HSPs98 can be configured per sync group 91, 92. So one HSP 98 can be set asthe host proxy for one sync group, e.g. 91A or 91B, whilst another HSP98 can be set as the host proxy for another group, e.g. 91B or 92; orthe same HSP 98 may be set as the host proxy for multiple groups, e.g.both 91 and 92. To this end the host interface 97 is connected to theHSPs 98 so that the HSP 98 selected for each group 91, 92 may beconfigurable by software by writing to registers of the HSP modules 98via the PCI interface 97. Alternatively it is not excluded that theconfiguration could be hard-wired or the HSP registers updated via adifferent interface or protocol. It is also not excluded that in yetfurther alternative embodiments, there could be a single fixed HSP 98per sync group 91, 92, or even a single fixed HSP 98 for the whole arrayor subsystem 6.

The or each host sync proxy (HSP) module 98 comprises hardware circuitryconfigured to enable the host 93 to participate in the respective syncgroup 91, 92 in which that HSP 98 is arranged to act as the host'sproxy. A sync request emitted by the tiles 4, if it is a sync with hostinvolvement, will be conveyed by the sync logic 95 to the active HSP 98for that group whereas a sync request which does not specify hostinvolvement will be aggregated and returned to the requesting tileswithout involving the HSP 98 in any way. Thus the tiles 4 determine byvirtue of the program they execute when, if at all, the acceleratorrequires to interact with the host via the HSP 98.

By way of illustration, consider an instance of the HSP 98 configured toact as proxy of the host 93 with respect to the global sync group 92.E.g. in FIG. 18, purely by way of illustration. It will be appreciatedthat analogous functionality can be described for the host'sparticipation in any, lower level sync group also, such as thoselabelled 91.

The host 93 is asynchronous and non-time-deterministic with respect tothe rest of the sync group 92, and separated by a relatively largeamount of wiring and physical logic. In addition any communication withthe host likely requires the host to take an interrupt following whichthere is a considerable latency for handling the interrupt and thenswitching contexts to the host code that would deal with the syncrequest. These factors mean the latency of any interaction involving thehost 93 is poor. It would be desirable to avoid needing to communicatedirectly with the host 93 as much as possible.

To this end, the HSP 98 comprises a set of registers comprising at leastone counter 99, and associated counting logic arranged to operate asfollows. The counter 99 is arranged so that an integer value n can bewritten to it by the host 93 via the host interface 97, in embodimentssuch that the value written is added to the value already present inthis register 99. The number in the counter 99 may be described as anumber of credits, or a mark count (e.g. ipu_mark_count). When the HSPcounter has a value of 1 or greater than in the sync group 92 in whichthe HSP 98 in question is acting as the host's proxy, the HSP 98 is thenconfigured to generate a sync acknowledgement (sync_ack) when itreceives a sync request from the tiles 4 in the sync group 92. Theassociated counting logic automatically decrements n by one in thecounter 99 each time a sync acknowledgement is generated and thecorresponding barrier is passed (e.g. barrier 80 in the case of syncgroup 92). This process occurs without the requirement for the HSP tocontact or otherwise interrupt the host. But if the counter value n hasnow reached zero, the HSP does not generate the sync-acknowledge andtherefore does not allow the tiles 4 in the group 92 to continue runningagain until both: i) all the tiles 4 in that group 92 have sent a syncrequest (sync_req), and ii) the HSP 98 performs a write to the HSP 98via the host interface 97 explicitly granting the barrier to bereleased. In embodiments, this second subcondition ii) is implemented bythe HSP 98 checking that the HSP counter 99 now has a value of 1 orgreater—i.e. the counter has been granted with more credits again by thehost 93 writing to the counter 99 via the host interface 97. Thus thetiles 4 of the group can be allowed to continue running through nbarriers without deferring at all to the host 93, after which they mustthen synchronize with the host 93 (and may then exchange data to and/orfrom the host). See for example FIG. 20. In some cases, the host mayarrange its operation for maximum efficiency by ensuring that the HSPcounter value never falls to zero and thus the accelerator never pausesto sync with the host.

Preferably the software running on the tiles 4 is free to choose whetherto request HSP involvement or not, by collectively marking theirrespective sync requests as either requiring or not requiring hostinvolvement. In such embodiments the above behaviour is applied only bythe HSP 98 for the barriers corresponding to sync requests marked asrequiring host involvement (the “involvement” of the host for any givenbarrier being either the proxy granting of the sync ack by the HSP 98 onbehalf of the host, or occasionally the explicit granting of morecredit). The program is arranged so that all tiles 4 in a given group91, 92 signal the same choice in their sync requests (HSP involvement ornot) for a given barrier synchronization. In embodiments the hostinvolvement is selected by different variants of the mode of the SYNCinstruction. That is, for each sync group 91, 92, there is effectivelytwo variants that the operand of the SYNC instruction can take:zone_1_host, zone_1_no_host; and zone_2_host, zone_2_no_host. Theexecution unit 18 is configured to act upon the operand, and in responseto cause the synchronization logic in the interconnect 72, 76 to signalthe host involvement marker accordingly. In other embodiments however,it is not excluded that other mechanisms could be implemented forrequesting host involvement, or even (though less preferred) that hostinvolvement is hardwired and therefore always imposed (i.e. counter 99is always consulted).

Another function of the HSP 98 is to notify the host by writing anotification message directly to the host's memory (in this embodiment,over the PCI interface). The notification message includes the currentcontents of the HSP 98 which includes the aforementioned counter value.Optionally the HSP 98 can also be configured to interrupt the host atthis point. The host therefore has the option of waiting for aninterrupt from the HSP or of polling the memory location written by theHSP with either method serving to alert the host to the current newstate of the HSP including the value of its counter. The host programmay then take such measures as it requires in order to prepare forfuture barriers following which it posts incremental values to the HSPcounter.

In embodiments, preparation for barriers performed by the host mayinclude the preparation of data to be fetched by the accelerator, suchas experience data sets required by the accelerator for the next stagein learning a model. Preparation in this context may include fetchingthe data from storage disks or other media, formatting data in a formwhich is required by the training algorithm running on the acceleratoror decompression of image data. Additionally, preparation for barriersmay include consuming output data produced by the accelerator.

Another function of the HSP 98 is to communicate the exit state value ofthe accelerator that accompanies the sync request from the Tiles 4 tothe host 93, via the notification message mentioned previously.

Another function of the HSP 98 is to allow the host program to specifyits own exit state value by writing it to one of the HSP registers.Thereafter when the HSP 98 generates a sync-acknowledge for the tiles 4,the aggregated exit state of all the tiles 4 is also aggregated with theexit state value that has been provided by the host 93.

Another function of the HSP 98 is to allow the host program to specifyan expected exit state value which corresponds to the exit state it mostcommonly expects the tiles 4 to provide along with their sync request.When the host 93 provides an expected exit state in this way, then solong as the tiles 4 exit state matches the value provided by the hostthe operation of the HSP is as described previously, with the HSPgenerating a sync-acknowledge while the HSP counter value n is greaterthan zero. Alternatively if the host's expected exit state value doesnot match the value provided by the tile 4 then the HSP 98 does notgenerate a sync-acknowledge to the Tiles 4. Because the tile's exitstate 4 is provided during the notification write mentioned above andthe accelerator will be stalled at the barrier where the tile exit stateand host exit state differ, the host program is able to take suchbarrier preparation measures as may be required to satisfy theconditions signalled by the change in exit state and then re-establishthe counter value n such that the value reflects the new preparationsmade. To facilitate this re-establishment of the counter value, the HSPinterprets a write to the HSP register with a count value of zero as aninstruction to zero the counter value rather than to increment thecounter value by zero which would have the undesired effect of leavingthe counter value unchanged.

An unexpected exit state event as described above may entail abandoningprevious preparations made by the host in anticipation of the Tile exitstate matching the expected value but in general the loss of efficiencyresulting from this event is small compared to the loss of efficiencythat would be incurred if the accelerator had to interrupt or involvethe host directly at each barrier, so long as the occurrence of theunexpected exit state value is rare relative to occurrences of theexpected exit state value.

N.B. an equivalent counter 99 for decrementing the number of creditscould be implemented as a counter that starts at zero and thenautomatically increments up toward a target value held in a register.Other implementations may also be apparent to a person skilled in theart. By “decrement” herein, it is meant to refer to the underlyingsubstantive effect of counting out a remaining number of automaticallydiminishing credits, rather than to refer to a particular implementationin terms of logical counting direction or such like.

In embodiments, the HSP 98 associated with each chip 2 comprises aplurality of instances of the counter 99 and the associated countinglogic, one instance for each of some or all of the possible sync groups91, 92 of which the respective chip can potentially be a member. Thusthe HSP 98 can maintain a different number of sync credits for each ofmultiple sync groups 91, 92, e.g. multiple hierarchical levels.Alternatively a given HSP 98 only comprises one counter 99 formaintaining the sync credits for one sync group, but there are multipleHSPs each of which can be configured to act as described above in adifferent respective one of the groups 91, 92 (e.g. multiplehierarchical levels). For example as described above, in embodimentsthere is one HSP 98 per chip 2, each which can be attached to a givensync group 91, 92 by the host 93. In other alternatives, it is notexcluded that there is only a single global HSP 98 with only a singlecounter 99 for maintaining a number of sync credits for a single syncgroup, e.g. the global group 92.

Also, in general, note that it is possible for the above arrangement tobe applied to one or more host processors 93. For instance, one HSP 98can be configured to involve one host processor 93 in one of the syncgroups 91, 91, whilst another HSP may be configured to involve anotherhost processor in another of the sync groups 91, 92. In this case eachthe HSP 98 of each host 93 represents its respective host 93 in relationto the respective sync group 91, 92 in a similar manner to thatdescribed above. Or in another example, in some embodiments it may bepossible to involve two host processors 93 in the same sync group 91 or92. In this case, a given HSP 98 may include a separate counter 99 foreach host 93; or different HSPs 98 may be set for a given group, one foreach host 93. Either way, the counters 99 are written with a respectivenumber of sync credits by each respective host 93. When either counter99 has decremented to zero a sync acknowledgement to the tiles 4 willnot be issued.

As mentioned previously, not all tiles 4 need necessarily participate inthe synchronization. In embodiments, as discussed, the group ofparticipating tiles can be set by the mode operand of the syncinstruction. However, this only allows for selection of predefinedgroups of tiles. It is recognized herein that it would also be desirableto be able to select sync participation on a tile-by-tile basis.Therefore in embodiments, there is provided an alternative or additionalmechanism for selecting which individual tiles 4 participate in thebarrier synchronization.

Particularly, this is achieved by providing an additional type ofinstruction in the processor instruction set, to be executed by one orsome tiles 4 in place of the SYNC instruction. This instruction may bereferred to as the “abstain” instruction, or “SANS” instruction (startautomatic non-participatory sync). In embodiments the SANS is reservedfor use by the supervisor thread. In embodiments it takes a singleimmediate operand:

SANS n_barriers

The behaviour of the SANS instruction is to cause the tile on which itis executed to abstain from the current barrier synchronization, butwithout holding up the other tiles which are waiting for all tiles inthe specified sync group to SYNC. In effect it says “go on without me”.When the SANS instruction is executed, the opcode of the SANSinstruction triggers the logic in the execution unit of the executionstage 18 to send an instance of the synchronization request signal(Sync_req) to the internal and/or external sync controller 36, 76(depending on the mode). In embodiments, the sync request generated bythe SANS applies to any sync group 91, 92 that encompass the tile 4 thatexecuted the SANS. I.e. for whatever sync group the tiles 4 in thislocal chip or chips are using next (they must agree on the sync group),the sync_req from those that have executed SANS will always be valid.

Thus from the perspective of the sync controller logic 36, 76 and theother tiles 4 in the sync group, the tile 4 executing the SANSinstruction appears exactly as a tile 4 executing a SYNC instruction,and does not hold up the sync barrier and the sending of the syncacknowledgment signal (Sync_ack) from the sync logic 36, 76. I.e. thetiles 4 executing the SANS instead of the SYNC does not hold up or stallany of the other tiles 4 involved any sync group of which the tile inquestion is otherwise a member. Any handshake performed by a SANS isvalid for all sync groups 91, 92.

However, unlike the SYNC instruction, the SANS instruction does notcause supervisor instruction issue to be paused awaiting the syncacknowledgment signal (Sync_ack) from the sync logic 36, 76. Instead therespective tile can simply continue uninhibited by the current barriersynchronization that is being conducted between the other tiles 4 thatexecuted SYNC instructions. Thus by mimicking a sync but not waiting,the SANS instruction allows its tile 4 to press on with processing oneor more tasks whilst still allowing the other tiles 4 to sync.

The operand n_barriers specifies the number of “posted” syncs, i.e. thenumber of future sync points (barriers) the tile will not beparticipating in. Alternatively it is not excluded that in otherembodiments the SANS instruction does not take this operand, and insteadeach execution of the SANS instruction causes only a one-off abstention.

By means of the SANS instruction, certain tiles 4 may be responsible forperforming tasks outside the direct scope of the BSP operating schedule.For example, it may be desirable to allocate a small number of tiles 4within a chip 2 to initiate (and process) data transfers to and/or fromhost memory while the majority of tiles 4 are occupied with the primarycomputation task(s). In such scenarios those tiles 4 not directlyinvolved with primary computation can declare themselves as effectivelydisconnected from the synchronization mechanism for a period of timeusing the automatic non-participatory sync feature (SANS). When usingthis feature, a tile 4 is not required to actively (i.e. via executionof the SYNC instruction) signal its readiness for synchronization (forany of the synchronization zones), and in embodiments makes a nullcontribution to the aggregated exit status.

The SANS instruction begins or extends a period during which the tile 4on which it is executed will abstain from active participation ininter-tile synchronization (or synchronization with other externalresources if they are also involved in the synchronization). During thisperiod, this tile 4 will automatically signal its readiness forsynchronization, within all zones, and in embodiments also make a nullcontribution to the global aggregated consensus $GC. This time periodmay be expressed as an unsigned immediate operand (n_barriers)indicating how many additional future synchronization points will beautomatically signalled by this tile 4. Upon execution of the SANS, thevalue n_barriers specified by its operand is placed into a countdownregister $ANS_DCOUNT on the respective tile 4. This is a piece ofarchitectural state used to keep a track of how many additional futuresync_reqs should be made. If the automatic non-participatory syncmechanism is currently inactive, the first assertion of readiness (syncrequest, sync_req) will be performed immediately. Subsequent assertionswill occur in the background, once the previous synchronization hascompleted (i.e. following assertion of the sync acknowledgment,sync_ack). If the automatic non-participatory sync mechanism iscurrently active, the countdown counter register $ANS_DCOUNT will beupdated in an automatic manner, such that no sync acknowledgment signalis left unaccounted for. The automatic non-participatory sync mechanismis implemented in dedicated hardware logic, preferably an instance of itin each tile 4, though in other embodiments it is not excluded that itcould instead be implemented centrally for a group of tiles or alltiles.

With regard to the exit state behaviour, there are in fact a number ofpossibilities depending on implementation. In embodiments, to obtain theglobally aggregated exit state, the sync logic 36, 76 only aggregatesthe local exit states from those tiles 4 in the specified sync groupthat executed a SYNC instruction, and not those that/those that executeda SANS instruction (the abstaining tile or tiles). Alternatively, theglobally aggregated exit state is obtained by aggregating the local exitstates from all the tiles 4 in the sync group that executed a SYNC andthose that executed a SANS (both the participating and abstaining tiles4). In the latter case, the local exit state output by the abstainingtile(s) 4 for global aggregation may be the actual locally aggregatedexit state of that tile's workers at the time of executing the SANS,just as with the SYNC instruction (see description of local consensusregister $LC 38). Alternatively the local “exit state” output by theabstaining tile 4 may be a default value, for instance the true value(e.g. logic 1) in embodiments where the exit state is binary. Thisprevents the abstaining tile 4 from interfering with the global exitstate in embodiments where any false local exit state causes the globalexit state to be false.

Regarding the return of the global exit state, there are twopossibilities for this, regardless of whether or not the abstaining tilesubmits a local exit state for producing the global aggregate, andregardless of whether that value was an actual value or a default value.That is, in one implementation, the global aggregate exit state producedby the sync logic 36, 76 in the interconnect 34, 72 is stored only inthe global consensus registers $GC 42 of the participating tiles 4,which executed a SYNC instruction, and not the abstaining tiles 4 whichinstead executed a SANS instruction. In embodiments, instead a defaultvalue is stored in the global consensus register $GX 42 of the tile(s) 4that executed a SANS (the abstaining tiles). For instance this defaultvalue may be true, e.g. logic 1, in the case of a binary global exitstate. In an alternative implementation however, the actual globalaggregate produced by the sync logic 36, 76 is stored in the globalconsensus registers $GC 42 of both the participating tiles 4 whichexecuted SYNC instructions and the abstaining tiles 4 which insteadexecuted a SANS instruction. Thus all tiles in the group may still haveaccess to the globally aggregated exit state.

FIG. 13 illustrates an example BSP program flow involving both internal(on-chip) and external (inter-chip) synchronizations. As shown, the flowcomprises internal exchanges 50 (of data between tiles 4 on the samechip 2) and the external exchanges 50′ (of data between tiles 4 ondifferent chips 2).

In embodiments, exchange of data via the internal (on-chip) interconnect34 can be made time deterministic, as will be discussed in more detailshortly with reference to FIGS. 16 and 17; whereas exchange of data viaan external interconnect 72 may be non-time-deterministic, e.g. due to alossy physical channel which will require retransmission of messages. Ingeneral an external interconnect could be made time-deterministic but itmay be difficult to do so or might confer too little advantage over anon-deterministic interconnect, and so may not be implemented inpractice.

It may be desirable to keep the internal communications timedeterministic so that they can be conducted without the need for queuesin the internal interconnect 34, since queues would incur an undesirablesilicon footprint in the interconnect 34. However, in embodimentsexternal communications may not be time deterministic.

As will be discussed in more detail shortly, the communication withoutqueues can be achieved by the compiler knowing the time at which eachtile 4 transmits its data, and also knowing the on-chip inter-tile delaybetween the transmitting and receiving tile. Given this predeterminedknowledge, the compiler can then program the receiving tile to listen tothe address of the transmitting tile at a specific, known time after thetransmission of the relevant data by the transmitting tile, i.e. thetransmit time plus the inter-tile delay. The timing of the transmissionis known by the compiler because the compiler itself selects at whichpoint in each thread to include the send instruction(s). Further, theinter-tile delay, for on-chip communications, is a fixed knowable valuefor a given pair of transmitting and receiving tiles 4. The compiler mayknow this from a look-up table of inter-tile delays for differentpossible combinations of sending and receiving tiles. The compiler canthen include the corresponding receive instruction, to listen to thesender's address, at the corresponding number of cycles after thetransmit instruction.

A global synchronization and exchange across multiple chips will also bemore “expensive” than for only an on-chip synchronization and exchangewith the total cost being that of the aforementioned internalsynchronization plus the additional delays required to aggregate thisglobally. Further, though in embodiments the sync signalling itself doesnot require flow control and is therefore relatively fast, the externalsynchronization syncs into an external exchange. An external exchangeexperiences longer latency and greater uncertainty versus an internalone.

Firstly, there is usually much less data bandwidth available inter-chipthan on-chip. This is because inter-chip wiring density is limited bypackage connection (ball or pad) density which is much lower than thewiring density available on chip. So communicating a fixed amount ofdata between chips will take much longer than on-chip, even iftransmission delays are similar. Also, external exchange is less local:wires reach further and hence are more capacitive, and more vulnerableto noise. This in turn may result in loss and hence the need for flowcontrol mechanism which provides for retransmission at the physicallayer, leading to reduced throughput (and loss of time determinism—seebelow). Further, as well as a greater physical distance, signalling anddata transmitted between chips typically has to traverse greater amountof logic such as SerDes (serializers-deserializers) and flow controlmechanisms, all of which adds extra delay compared to internalcommunications. For instance, the inventors have identified that usingconventional technologies, an external barrier synchronization processcan be expected to take of the order of ten times longer than aninternal synchronization, and may account for 5-10% of the programrunning time. Using the hardware synchronization mechanism disclosedherein this can be reduced to the order of three times slower, but isstill slower than an internal synchronization. Further, the exchange ofdata externally will, e.g. due to factors such as loss andretransmission at the physical layer due to noise, and/or serializationand deserialization between chips.

In other variants the interconnect between chips may be lossless at thephysical and/or link layer, but is actually lossy at the highernetworking layer due to contention of network layer flows betweendifferent sources and destinations causing queues to be over-flowed andpackets dropped. This is how Ethernet works and it is envisaged that analternative non-time-deterministic interconnect may employ Ethernet.Note also: it is the case that any exchange process, whether lossless orlossy, can actually suffer unrecoverable errors (e.g. due to alpharadiation) which result in total exchange failure and which cannot berecovered by any hardware mechanism (e.g. link layer). In both thetime-deterministic cases and non-time-deterministic cases, inembodiments the system may detect but not correct such errors. Oncedetected, the error may be signalled to the host, whose strategy may beto require that the BSP application state be periodically checkpointedand in the event of such a fatal hardware error, rollback the state ofthe application to the last checkpoint. By this mechanism, even lossymechanisms used to effect data exchanges can be made to appear losslessto the user, at some performance cost.

As illustrated in FIG. 13, in embodiments it is disclosed to keep theinternal BSP supersteps (comprising the internal exchanges 50 of databetween tiles 4 on the same chip 2) separate from the external sync andexchange (comprising the external exchanges 50′ of data between tiles 4on different chips 2).

Accordingly, the program may be arranged to perform a sequence ofsynchronizations, exchange phases and compute phases comprising in thefollowing order: (i) a first compute phase, then (ii) an internalbarrier synchronization 30, then (iii) an internal exchange phase 50,then (iv) an external barrier synchronization 80, then (v) an externalexchange phase 50′. See chip 2II in FIG. 13. The external barrier 80 isimposed after the internal exchange phase 50, such that the program onlyproceeds to the external exchange 50′ after the internal exchange 50.Note also that as shown with respect to chip 2I in FIG. 12, optionally acompute phase may be included between internal exchange (iii) andexternal barrier (iv).

This overall sequence is enforced by the program (e.g. being generatedas such by the compiler). In embodiments the program is programmed toact in this way by means of the SYNC instruction described previously.The internal synchronization and exchange does not extend to any tilesor other entities on another chip 2. The sequence (i)-(v) (with theaforementioned optional compute phase between iii and iv) may berepeated in a series of overall iterations. Per iteration there may bemultiple instances of the internal compute, sync and exchange (i)-(iii)prior to the external sync & exchange. I.e. multiple instances of(i)-(iii) (retaining that order), i.e. multiple internal BSP supersteps,may be implemented before (iv)-(v), i.e. the external sync and exchange.Note also, any of the tiles 4 may each be performing their own instanceof the internal synchronization and exchange (ii)-(iii) in parallel withthe other tiles 4.

Thus per overall BSP cycle (i)-(v) there is ensured to be at least onepart of the cycle (ii)-(iii) wherein synchronization is constrained tobeing performed only internally, i.e. only on-chip.

Note that during an external exchange 50 the communications are notlimited to being only external: some tiles may just perform internalexchanges, some may only perform external exchanges, and some mayperform a mix. However, due to the loss of time determinism that occursin the external interconnect 72 in some embodiments, then in suchembodiments, once a tile has performed an external communication itcannot perform an internal communication again until the nextsynchronization (see below explanation of the preferred on-chipcommunication mechanism which relies on predetermined knowledge ofmessage timing and inter-tile delays).

In some embodiments, also as shown in FIG. 13, some tiles 4 may performlocal input/output during a compute phase, for example they may exchangedata with a host. Note also that as shown in FIG. 13, it is in generalpossible for any or all tiles to have a null compute phase 52 or a nullexchange phase 50 in any given BSP superstep.

In embodiments, the different levels of sync zones 91, 92 may be used toconstrain the extent of some of the external sync & exchange operationsto only a subgroup of the chips 2 in the system, and limit the number oftimes the penalty of a full, global sync and exchange is needed. Thatis, the overall cycle may comprise: (i) a first compute phase, then (ii)an internal barrier synchronization, then (iii) an internal exchangephase, then (iv) an external barrier synchronization 80 within the tilesof only a first, lower level sync zone 91; then (v) an external exchangephase between only the chips of the first sync zone 91; then (vi) anexternal barrier synchronization across a second, higher level sync zone92; then (vii) an external exchange phase amongst the chips of thesecond level sync zone 92. The external barrier to the second levelexchange phase is imposed after the first level external exchange phase,such that the program only proceeds to the second level externalexchange after the first level exchange phase. This behaviour may beprogrammed by using the SYNC instruction qualified by different levelsof the external mode in its operand.

In embodiments the highest hierarchical level of sync zone encompassesall the tiles 4 on all chips 2 in the array 6, i.e. it is used toperform a global sync. When multiple lower-level zones are used, BSP maybe imposed internally amongst the group of tiles 4 on the chip(s) 2within each zone, but each zone may operate asynchronously with respectto one another until a global sync is performed.

Note: with regard to the lower-level external synchronization andexchange (iv)-(v), any of the lower-level zones 91A, 91B may each beperforming its own instance of the lower-level external exchange inparallel with the other lower-level zone(s). And/or, in some casesmultiple instances of (i)-(v) may be implemented before (vi)-(vii), i.e.there may be multiple instances of the lower-level external BSPsuperstep before the external sync and exchange. Further, the schemecould be extended to three or more hierarchical levels of sync zone.

In general the host 93 may be involved in any one or more of thehierarchical levels of sync.

An example is illustrated schematically in FIG. 20 for the global synczone 92. The system is allowed to perform a number P of BSP iterationsp, passing through P sync barriers 80, before a barrier 90 alsorequiring sync acknowledgment from the host 93 is imposed. The P syncbarriers require sync requests from all the (non abstaining) tiles 4 inthe relevant sync group 92 but not the host 93. The subsequent syncbarrier 80 requires sync requests from all the (non abstaining) tiles 4in the sync group 92 and that the host 93 has previously indicatedpermission to pass the particular barrier. After this barrier 90 anexchange 50″ may be performed between the host 93 and one or more of thetiles 4, e.g. for one or more of the tiles 4 to report computationresults to the host 93.

In embodiments, exchange of data on-chip (internal exchange) may beperformed in a time-deterministic manner without the need for queues.Reference is made to FIG. 16. The communication without queues can beachieved by the compiler knowing the time at which each tile 4 transmitsits data, and also knowing the on-chip inter-tile delay between thetransmitting and receiving tile. Given this predetermined knowledge, thecompiler can then program the receiving tile to listen to the address ofthe transmitting tile at a specific, known time after the transmissionof the relevant data by the transmitting tile, i.e. the transmit timeplus the inter-tile delay. The timing of the transmission is known bythe compiler because the compiler itself selects at which point in eachthread to include the send instruction(s). Further, the inter-tiledelay, for on-chip communications, is a fixed knowable value for a givenpair of transmitting and receiving tiles 4. The compiler may know thisfrom a look-up table of inter-tile delays for different possiblecombinations of sending and receiving tiles. The compiler can theninclude the corresponding receive instruction, to listen to the sender'saddress, at the corresponding number of cycles after the transmitinstruction.

On each chip 2, the chip 2 comprises a respective clock which controlsthe timing of chip activity. The clock is connected to all of the chip'scircuits and components. The chip 2 also comprises the internal,time-deterministic interconnect or “switching fabric” 34 to which alltiles and links are connected by sets of connection wires. Inembodiments the interconnect 34 may be stateless, in that it has nostate readable by software. Each set of connection wires is fixed end toend. The wires are pipelined. Each set can carry a packet consisting ofone or more datums, with one datum being transferred per clock cycle.But note herein that the word “packet” denotes a set of bitsrepresenting a datum (sometimes referred to herein as a data item),perhaps with one or more valid bit. The “packets” do not have headers orany form of destination identifier (which permits an intended recipientto be uniquely identified), nor do they have end-of-packet information.Instead, they each represent a numerical value input to or output from atile. Each tile has its own local memory (described later). The chip 2has no shared memory. The switching fabric 24 constitutes a cross set ofconnection wires only and also does not hold any state. Data exchangebetween tiles on the same chip is conducted on a time deterministicbasis as described herein. A pipelined connection wire comprises aseries of temporary stores, e.g. latches or flip flops which hold datumfor a clock cycle before releasing it to the next store. Time of travelalong the wire is determined by these temporary stores, each one usingup a clock cycle of time in a path between any two points.

Each tile 4 indicates its synchronisation state to the sync controller36 in the internal interconnect 34. Once it has been established thateach tile 4 is ready to send data, the synchronisation process 30 causesthe system to enter the exchange phase 50. Note that each tileexperiences the sync_ack with a different but known time delay. Thesupervisor program inserts additional cycle delays as required such thateach tile begins its exchange phase on the exact same cycle. In thisexchange phase, data values move between tiles (in fact between thememories of tiles in a memory-to-memory data movement). In the exchangephase, there are no computations and therefore no concurrency hazards(or at least there are no computations that reply on data yet to bereceived from another tile 4). In the exchange phase, each datum movesalong the connection wires on which it exits a tile from a transmittingtile to its recipient tile. At each clock cycle, datum moves a certaindistance along its path (store to store), in a pipelined fashion. When adatum is issued from a tile, it is not issued with a header identifyinga recipient tile. Instead, the recipient tile knows that it will beexpecting a datum from a certain transmitting tile at a certain time.Thus, the computer described herein is time deterministic.

Each tile 4 runs a portion of the program which has been allocated to itby the programmer or by a compiler exercise, where the programmer or thecompiler function has knowledge of what will be transmitted by aparticular tile at a certain time and what needs to be received by arecipient tile at a certain time. In order to achieve this, SENDinstructions are included in the local programs executed by theprocessor on each tile, where the time of execution of the SENDinstruction is predetermined relative to the timing of otherinstructions being executed on other tiles in the computer.

Each tile 4 is associated with its own multiplexer 210. Each multiplexerhas at least as many inputs as there are tile 4 on the chip, each inputbeing connected to the switching fabric 34. The cross wires of theswitching fabric are connected to a data-out set of connection wires 218from each tile (a broadcast exchange bus). For ease of illustration, notall crosswire are shown in FIG. 16. One set of crosswires is labelled140 x to indicate that it is one of a number of sets of crosswires.

When the multiplexer 210 is switched to the input labelled 220 x thenthat will connect to the crosswires 140 x and thus to the data bus 218Tof the transmitting (sending) tile 4T. If the multiplexer is controlledto switch to that input at a certain time, then the datum received onthe data bus 230 which is connected to the crosswire 140 x will appearat the output of the multiplexer 210 at a certain time. It will arriveat the receiving tile 4R a certain delay after that, the delay dependingon the distance of the multiplexer 210 from the receiving tile 4R. Asthe multiplexers tend to be arranged close to the switching fabric, thedelay from the tile to the multiplexer can vary depending on thelocation of the receiving tile 4R.

To implement the switching, the local programs executed on the tiles 4include switch control instructions (PUTi) which cause a multiplexercontrol signal 214 to be issued to control the multiplexer 210associated with that tile to switch its input at a certain time ahead ofthe time at which a particular datum is expected to be received at thetile. In the exchange phase, multiplexers are switched and packets(data) are exchanged between tiles using the switching fabric. It can beseen from this explanation that the internal interconnect 34 has nostate and requires no queues—the movement of each datum is predeterminedby the particular crosswire to which the input of each multiplexer isconnected.

In the exchange phase, all tiles 4 are permitted to communicate with allother tiles within its sync group. Each tile 4 has control of its ownunique input multiplexer 210. Incoming traffic can thus be selected fromany other tile in the chip 2 (or from one of the external connectionlinks in an external exchange). It is also possible for a multiplexer210 to be set to receive a null input, i.e. no input, in any givenexchange phase.

Each tile 4 has three interfaces: an “exin” interface 224 which passesdata from the switching fabric 34 to the tile 4; an “exout” interface226 which passes data from the tile to the switching fabric over thebroadcast exchange bus 218; and an “exmux” interface 228 which passesthe control mux signal 214 (mux-select) from the tile 4 to itsmultiplexer 210.

In order to ensure each individual tile executes SEND instructions andswitch control instructions at appropriate times to transmit and receivethe correct data, exchange scheduling requirements need to be met by theprogrammer or compiler that allocates individual programs to theindividual tiles in the computer. This function is carried out by anexchange scheduler, preferably at compile time, which needs to be awareof the following parameters.

Parameter I: the relative SYNC acknowledgement delay of each tile. Thisis a function of tile ID (TID) of the sending and receiving tiles, whichis held in the TILE_ID register. This is a number of cycles alwaysgreater than or equal to 0 indicating when each tile receives the syncack signal from the sync controller 36 relative to all other tiles. Thiscan be calculated from the tile ID, noting that the tile ID indicatesthe particular location on the chip of that tile, and therefore reflectsthe physical distances. Put another way, the sync ack delays areequalized. If the transmitted tile 4T is closer to the sync controller36 and the receiving tile 4R is further away, the consequence is thatthe sync acknowledgement delay will be shorter to the transmitting tile4T than for the receiving tile 4R, and vice versa. A particular valuewill be associated with each tile for the sync acknowledgement delay.These values can be held for example in a delay table, or can becalculated on the fly each time based on the tile ID.

Parameter II: the exchange mux control loop delay. This is the number ofcycles between issuing an instruction (PUTi MUXptr) that changes atile's input mux selection and the earliest point at which the same tilecould issue a (hypothetical) load instruction for exchange data storedin memory as a result of the new mux selection. This comprises the delayof the control signal getting from the exmux interface 228R ofrecipients tile 4R to its multiplexer 210R and the length of the linefrom the output of the multiplexer to the data input exin interface 224.

Parameter III: the tile to tile exchange delay. This is the number ofcycles between a SEND instruction being issued on one tile and theearliest point at which the receiving tile could issue a (hypothetical)load instruction pointing to the sent value in its own memory. This canbe calculated from the TIDs of the sending and receiving tiles, eitherby accessing a table, or by calculating on the fly. This delay includesthe time taken for data to travel from transmit tile 4T from its exoutinterface 226T to the switching fabric 14 along its exchange bus 218Tand then via the input mux 210R at the receiving tile 4R to the ex ininterface 224R of the receiving tile.

Parameter IV: the exchange traffic memory pointer update delay. This isthe number of cycles between issuing an instruction (PUTi MEMptr) thatchanges a tile's exchange input traffic memory pointer 232 and theearliest point at which that same tile could issue a (hypothetical) loadinstruction for exchange data stored in memory as a result of the newpointer. This is a small, fixed number of cycles. The memory pointer 232acts as a pointer into the data memory 202 and indicates where incomingdata from the exin interface 224 is to be stored.

Together these parameters give the total inter-tile delay that will beexperienced between transmission of a datum from the transmitting tile4T and receipt of that datum by the receiving tile 4R. The particularexchange mechanism and parameters above are given only by way ofexample. Different exchange mechanisms may differ in the exactcomposition of the delay, but as long as the exchange is kept timedeterministic, then it can be known by the programmer or compiler andthus exchange without queues is possible.

FIG. 17 shows the example exchange timings in more depth. On theleft-hand side are shown the chip clock cycles running from 0-30. If theprocessor of the receiving tile 4R wants to act on a datum which was theoutput of a process on the transmitting tile 4T, then the transmittingtile 4T has to execute a SEND instruction send at a certain time (e.g.clock cycle 0 in FIG. 17), and the receiving tile 4R has to execute aswitch control instruction PUTi EXCH MXptr (as in clock cycle 11) by acertain time relative to the execution of the SEND instruction on thetransmitting tile. This will ensure that the data arrives at therecipient tile in time to be loaded for use in a code-let being executedat the recipient tile 4R.

FIG. 19 illustrates an exemplary mechanism for communicating off-chip(external exchange). This mechanism is non-time-deterministic. Themechanism is implemented in dedicated hardware logic in the externalinterconnect 72. Data is sent over the external interconnect 72 in theform of packets. Unlike the packets sent over the internal interconnect,these packets have headers: as the order of transmission can change,they require the destination address to be present in the packet header.Also in embodiments the external interconnect 72 takes the form of anetwork and therefore requires additional information for routingpurposes.

At the physical layer the interconnect mechanism is lossy, but at thetransaction layer the mechanism is not lossy due to the architecture ofthe link layer: if a packet is not acknowledged it will be resentautomatically by the hardware in the interconnect 72. The possibilityfor loss and resending at the data link layer however means that thedelivery of data packets over the external interconnect is nottime-deterministic. Further, all the packets of a given exchange mayarrive together or separated apart in time, and in any order, so theexternal interconnect requires flow control and queuing. Further, theinterconnect may use clock-data-recovery (CDR) technology to infer aclock from a received data stream having sufficient data signaltransitions to maintain bit-lock. This inferred clock will be of unknownphase relationship to the sending clock and hence represent anadditional source of non-determinism.

As illustrated, the external interconnect 72 comprises an externalexchange block (XB) 78. The compiler nominates one of the tiles 4 tosend an external exchange request (XREQ) to the exchange block 78(operation S1). The XREQ is a message comprising one or more controlpackets, indicating which of the tiles 4 have data packets (content) tosend to another tile or tiles 4 on another chip 2. This is illustratedschematically in FIG. 19 by the ticks and crosses: by way of an examplescenario, those labelled with a tick have data packets to sendexternally and those labelled with a cross do not. In operation S2, theexchange block 78 sends an exchange-on (XON) control packet to a firstof the tiles 4 with data to send externally. This causes the first tileto start sending its packets to the relevant destination via theexternal interconnect 78 (operation S3). If at any time the XB is unableto continue sending packets to the interconnect (e.g. due to a previouspacket loss and re-transmission in the interconnect, or due toover-subscription of the external interconnect by many other XBs andtiles) the XB will send an exchange-off (XOFF) to that tile before theXBs queue overflows. Once the congestion is cleared and the XB again hassufficient space in its queue it will send an XON to the tile allowingit to continue transmitting its content. Once this tile has sent itslast data packet, then in operation S4 the exchange block 78 sends anexchange-off (XOFF) control packet to this tile, then in operation S5sends another XON to the next tile 4 with data packets to send, and soforth. The signalling of XON and XOFF are implemented as a hardwaremechanism in dedicated hardware logic in the form of the externalexchange block 78.

In embodiments the exchange block 78 may comprise a plurality ofexchange block contexts. Each exchange block context is a piece ofhardware logic for implementing a respective instance of the exchangemechanism described above. An exchange block context independentlyissues exchange-on and off to a subset of tiles configured to listen tothat context. In this case an exchange block is a convenient grouping ofcontexts for physical layout, and for providing a bandwidth in terms ofphysical bus width to match that offered by the on-chip system-on-chip(SOC) interconnect 34 (the non-deterministic interconnect). For examplean exchange block 78 may comprise four or eight exchange block contexts.Multiple blocks 78 may also be provided. Thus the external interconnectcan process more exchanges in parallel. The division of thefunctionality divided between multiple exchange contexts and/or blocksis a matter of physical layout convenience and matching width/bandwidthwith the SOC interconnect. However this is optional. In a chip 2 withjust a few external links (e.g. just a host link and no chip-to-chiplinks), one could instead use just a single exchange block, or even anexchange block which has a single context.

An external exchange occurs whenever communication is required with atile instance 4 within another chip 2 (e.g. another IPU), or a hostsystem 93. The operation of external exchange differs significantly frominternal exchange. Firstly, the external interconnect 72 is a sharedresource, typically with much higher latency and lower bandwidth thanthat offered by the internal exchange fabric 34. Data transfers viaexternal exchange are subject to arbitration and back-pressure and theassociated latencies may be variable (i.e. cannot be staticallydetermined). Secondly, exchanges of data are performed via transferproxies (i.e. the exchange block contexts). A tile instance 4communicates only with the on-chip proxies and never directly with thetarget of the transfer. Third, data transfers involve the formation oftransaction packets in tile memory 22 and it is those packets which areused to communicate with the transfer proxies. The external exchangesupports a number of synchronisation zones, which may have uniquecharacteristics.

External exchange transmission involves the formation and transmissionof transaction packets which are used to communicate with the on-chiptransfer proxies. Such packets are formed in tile memory 22 by the tile4, as per any other data structure and transmitted to a transfer proxyusing send and/or send-off instructions (SEND, SENDOFF) following anexternal sync.

There is no restriction on the number of send instructions used totransmit a single transaction packet. A single send instruction cannotbe used to transmit multiple packets. In one implementation the sendoffinstruction has an enforced upper-limit for the data size of 64 words(256 bytes). An exception event will be raised when attempting toexecute a sendoff instruction with a larger payload. Send instructionsare subject to flow control and will stall at issue when flow-control isoff.

One advantage of the disclosed mechanism is that no DMA engine isnecessarily required for the tiles. Instead a (preferably small) subsetof the tiles are nominated by the compiler as I/O tiles for sendingand/or receiving data off-chip. Because the chip 2 comprises a highdensity of small tiles, some number can be allocated to I/O withoutcompromising the performance of the rest of the tiles, thus obviatingthe argument for a DMA engine. Also the exchange mechanism is configuredto service each of the multiple I/O tiles in turn to ensure that betweenthe tiles the bandwidth of the external link (e.g. PCI or Ethernet) ismade good use of, preferably saturated.

Hence in embodiments the processor chip 2 comprises at least no on-chipDMA. Regarding off-chip DMA, in some cases a gateway of the hostsubsystem 93 may have some DMA functionality, but in general this isused to move data from remote storage or CPU over an Ethernet network,which it then writes to the tiles 4. Alternatively, the data could bemoved into gateway memory and then tiles could read it direct fromthere. For data moving the other way, the tiles write the data directlyto the gateway memory, which then moves that data using DMA to remotehost or storage separately. Even when the gateway writes data to thetiles, it is doing so in a BSP aware manner, so really the gatewayfunction can be thought of as another kind of tile.

So in some cases the system may make use of some external DMA-likeresource, but the reason is because that this type of DMA over Ethernettypically requires large networking stacks that cannot be run on thechip 2. The gateway may include one or more CPU cores which run thosenetworking stacks, and which are armed with DMA units (as is the casewith almost any general purpose processor). So the system still hasessentially a non-DMA process between tiles and a pseudo-tile in thegateway, with an entirely decoupled DMA between gateway and remotehost/storage.

Note: in embodiments the flow-control mechanism may be such that a tileinstance 4 may receive a tail of superfluous flow-control (XFC) packetsat the end of an external exchange transmit sequence. If these old,asynchronous flow-control packets arrive after the execution of asubsequent external SYNC instruction, a tile instance 4 may incorrectlydeduce that it has permission to send further exchange data for the nextexchange phase (the default setting of the tile transmit flow-control(XOFF) applied by the sync instruction may have been overridden by asubsequently received, late flow-control message). Therefore an internalSYNC may be used at the end of an external exchange transmit sequence inorder to allow time for any old flow-control packets to propagate. Thiswill ensure that the XB exchange bus is quiet prior to beginning a newexternal exchange transmission (which begins with the execution of asubsequent, external SYNC).

With regard to the XREQ packets, the on-chip exchange block contexts areused to arbitrate the external exchange resources between a fixed groupof tile instances 4 and to orchestrate the flow-control for that group.For any external sync, each tile instance 4 may declare itself a masterfor that group, or a slave, using the appropriate argument to SYNC.

The difference between a master and slave is small but in embodiments isrelevant for the operation of external exchange. At the beginning of anexternal exchange sequence, the flow-control mechanism prevents eachtile 4 from transmitting exchange packets. However the protocolspecifies that an XREQ packet be sent to each exchange block contextthat is to participate in the external exchange, with the XREQ packetspecifying which tile instances 4 in the group have data to send. Theexchange block context will then control the arbitration between theparticipating tiles 4. Master tile instances are endowed with theability to execute a single send or sendoff instruction followingexecution of an external SYNC which ignores the flow-control setting.This allows those master tiles to force send an XREQ packet to itsexchange block context in order to kick-start that context.

Only one tile instance 4 per group should be designated as the masteralthough in embodiments there is no explicit checking for this. Eachexchange block context is preconfigured with the ID of the tile 4designated as the master for that group. If the exchange block contextreceives an XREQ packet from a different tile 4 then an error will beraised by the exchange block 78.

In embodiments the execution sync instructions, with one of the externalslave enumerations, will force a reset of the local tile flow-controlstatus to its default setting (XOFF).

Receive for external exchange differs significantly from that forinternal exchange. When operating in external receive mode, the exchangeinterface 311 receives and interprets transaction packets from theon-chip exchange proxies. Those packets include metadata that specifythe type of transaction and in the case of writes, a tile memory startaddress and payload length. For incoming writes, only the actual datapayloads are committed to tile memory, with all metadata being strippedoff by the exchange interface 311.

The CSR state $INCOMING_MUX is relevant to external exchange. It is usedto configure the incoming data multiplexer 210, in order to sample thedata from the designated sender. Each tile instance 4 has its own,unique input multiplexer 210 allowing the selection of traffic from anytile within the IPU (for Internal Exchange), or from an exchange block78 (for external exchange). This value must be within the rangeassociated with external exchange (i.e. explicitly pointing at atransfer proxy) for the exchange interface 311 to operate in externalexchange mode. In embodiments the NULL range is not a valid range forexternal exchange.

Note that in embodiments, there is no flow control mechanism by whichthe tile 4 can indicate to the exchange block 78 that the exchange blockis permitted to send to the tile, and nor is this required. This isbecause the tile 4 is capable, by design, of always consuming everythingthat is sent to it. If this were not the case then such a reversedirection flow control would be required. This capability of the tile 4arises firstly from the requirement it has in the time-deterministicmode to never block receipt (flow control cannot be employed in atime-deterministic system), and secondly from the fact that there is noconcept of a queue in the tile since the compiler has knowledge of howmuch memory space the receiving tile has for new messages at thebeginning of each exchange and arranges data transfers such that thismemory allocated for messages in a given exchange is neverover-subscribed.

FIG. 15 illustrates an example application of the processor architecturedisclosed herein, namely an application to machine intelligence.

As will be familiar to a person skilled in the art of machineintelligence, machine intelligence begins with a learning stage wherethe machine intelligence algorithm learns a knowledge model. The modelcomprises a graph of interconnected nodes (i.e. vertices) 102 and edges(i.e. links) 104. Each node 102 in the graph has one or more input edgesand one or more output edges. Some of the input edges of some of thenodes 102 are the output edges of some others of the nodes, therebyconnecting together the nodes to form the graph.

Further, one or more of the input edges of one or more of the nodes 102form the inputs to the graph as a whole, and one or more of the outputedges of one or more of the nodes 102 form the outputs of the graph as awhole. Sometimes a given node may even have all of these: inputs to thegraph, outputs from the graph and connections to other nodes. Each edge104 communicates a value or more often a tensor (n-dimensional matrix),these forming the inputs and outputs provided to and from the nodes 102on their input and output edges respectively.

Each node 102 represents a function of its one or more inputs asreceived on its input edge or edges, with the result of this functionbeing the output(s) provided on the output edge or edges. Each functionis parameterized by one or more respective parameters (sometimesreferred to as weights, though they need not necessarily bemultiplicative weights). In general the functions represented by thedifferent nodes 102 may be different forms of function and/or may beparameterized by different parameters.

Further, each of the one or more parameters of each node's function ischaracterized by a respective error value. Moreover, a respectivecondition may be associated with the error(s) in the parameter(s) ofeach node 102. For a node 102 representing a function parameterized by asingle parameter, the condition may be a simple threshold, i.e. thecondition is satisfied if the error is within the specified thresholdbut not satisfied if the error is beyond the threshold. For a node 102parameterized by more than one respective parameter, the condition forthat node 102 having reached an acceptable level of error may be morecomplex. For example, the condition may be satisfied only if each of theparameters of that node 102 falls within respective threshold. Asanother example, a combined metric may be defined combining the errorsin the different parameters for the same node 102, and the condition maybe satisfied on condition that the value of the combined metric fallswithin a specified threshold, but otherwise the condition is notsatisfied if the value of the combined metric is beyond the threshold(or vice versa depending on the definition of the metric). Whatever thecondition, this gives a measure of whether the error in the parameter(s)of the node falls below a certain level or degree of acceptability. Ingeneral any suitable metric may be used. The condition or metric may bethe same for all nodes, or different for different respective ones ofthe nodes.

In the learning stage the algorithm receives experience data, i.e.multiple data points representing different possible combinations ofinputs to the graph. As more and more experience data is received, thealgorithm gradually tunes the parameters of the various nodes 102 in thegraph based on the experience data so as to try to minimize the errorsin the parameters. The goal is to find values of the parameters suchthat the output of the graph is as close as possible to a desired outputfor a given input. As the graph as a whole tends toward such a state,the graph is said to converge. After a suitable degree of convergencethe graph can then be used to perform predictions or inferences, i.e. topredict an outcome for some given input or infer a cause for some givenoutput.

The learning stage can take a number of different possible forms. Forinstance, in a supervised approach, the input experience data takes theform of training data, i.e. inputs which correspond to known outputs.With each data point, the algorithm can tune the parameters such thatthe output more closely matches the known output for the given input. Inthe subsequent prediction stage, the graph can then be used to map aninput query to an approximate predicted output (or vice versa if makingan inference). Other approaches are also possible. For instance, in anunsupervised approach, there is no concept of a reference result perinput datum, and instead the machine intelligence algorithm is left toidentify its own structure in the output data. Or in a reinforcementapproach, the algorithm tries out at least one possible output for eachdata point in the input experience data, and is told whether this outputis positive or negative (and potentially a degree to which it ispositive or negative), e.g. win or lose, or reward or punishment, orsuch like. Over many trials the algorithm can gradually tune theparameters of the graph to be able to predict inputs that will result ina positive outcome. The various approaches and algorithms for learning agraph will be known to a person skilled in the art of machine learning.

According to an exemplary application of the techniques disclosedherein, each worker thread is programmed to perform the computationsassociated with a respective individual one of the nodes 102 in amachine intelligence graph. In this case at least some of the edges 104between nodes 102 correspond to the exchanges of data between threads,and some may involve exchanges between tiles. Furthermore, theindividual exit states of the worker threads are used by the programmerto represent whether or not the respective node 102 has satisfied itsrespective condition for convergence of the parameter(s) of that node,i.e. has the error in the parameter or parameters fallen within theacceptable level or region in error space. For instance, this is oneexample use of the embodiments where each of the individual exit statesis an individual bit and the aggregated exit state is an AND of theindividual exit states (or equivalently an OR if 0 is taken to bepositive); or where the aggregated exit state is a trinary valuerepresenting whether the individual exit states were all true, all falseor mixed. Thus, by examining a single register value in the exit stateregister 38, the program can determine whether the graph as whole, or atleast a sub-region of the graph, has converged to an acceptable degree.

As another variant of this, embodiments may be used where theaggregation takes the form of a statistical aggregation of individualconfidence values. In this case each individual exit state represents aconfidence (e.g. as a percentage) that the parameters of the noderepresented by the respective thread have reached an acceptable degreeof error. The aggregated exit state can then be used to determine anoverall degree of confidence as to whether the graph, or a subregion ofthe graph, has converged to an acceptable degree.

In the case of a multi-tile arrangement 6, each tile runs a subgraph ofthe graph. Each subgraph comprises a supervisor subprogram comprisingone or more supervisor threads, and a set of worker threads in whichsome or all of the workers may take the form of codelets.

It will be appreciated that the above embodiments have been described byway of example only.

For instance, in alternative scenarios, the scope of the presentdisclosure is not limited to a time-deterministic internal interconnector a non-time-deterministic external interconnect. It would also bepossible to make the divide between the time-deterministic andnon-time-deterministic realms in other ways. For instance it is notexcluded to extend the time-deterministic domain across multiple chips2, with different multi-chip time deterministic domains being connectedby a non-time-deterministic interconnect (e.g. the different multi-chiptime-deterministic domains being implemented on different cards orserver chassis). Or as another example, different time-deterministicdomains could be implemented on a given chip 2, with anon-time-deterministic on-chip interconnect being provided between suchdomains. Or communications between all tiles 4 or modules could even benon-time-deterministic, with no time-deterministic exchanges at all.

Where a time-deterministic interconnect is used, the implementation isnot limited to use of an inter-tile delay look up table. Instead forexample an analytical formula could be used to determine the inter-tiledelay. Further, the inter-tile delay and the send and receive timingsare not limited to being set by the compiler. E.g. alternatively theycould be arranged manually by the programmer.

Further, the disclosed exchange mechanism is not limited to use with anon-time-deterministic exchanges. Even in a system where all tiles 4,chips 2 or other such processing modules can exchange data with oneanother in a time-deterministic manner, the disclosed exchange mechanismmay still be desirable to enable exchange without either requiring arendez vous or postbox mechanism or the program having to know the exacttimings of the exchange. Though that is disclosed for the internalinterconnect 34 in embodiments herein, that requires carefulpredetermination of the program timing which may not necessarily bedesirable for all possible use cases.

Moreover, the applicability of the disclosed exchange mechanism is notlimited to BSP. While it provides a particularly useful mechanism forseparating between the exchange phase and the compute phase in a BSPsuperstep, more generally it can also be used in any scenario where itis desired to synchronize the next actions of a processor module withthe receipt of some predetermined or specified amount of data.

On a given tile or processor, the implementation is not limited to theabove-described architecture in which a separate context is provided forthe supervisor thread, or in which the supervisor thread runs in a slotand then relinquishes its slot to a worker. The supervisor could insteaduse a general purpose context. Or in another arrangement for example,the supervisor may run in its own dedicated slot. Further, theimplementation is not limited to specific one of the threads even havinga supervisor role, or indeed to multi-threading at all. The techniquesdisclosed herein may even be used in scenarios where one, some or all ofthe tiles on one, some or all of the chips employ non-multithreadedexecution.

Where used, the applicability of a host sync proxy is not limited tosystems allowing selection between different sync groupings. Even in asystem having only a single sync domain (single group of tiles 4 acrosswhich a barrier synchronization is performed), it would still bebeneficial to be able to reduce the amount of host interaction bysetting a certain number of barriers that the tiles 4 are allowed topass through before deferring to the host 93.

Further, though embodiments have been exemplified in terms of a PCIinterface between cards or with the host 93, this is not limiting andother types of interface could be used, e.g. Ethernet.

Where multithreaded tiles are used, the terms “supervisor” and “worker”do not necessarily have to imply specific responsibilities expect whereotherwise explicitly stated, and particularly are do not in themselvesnecessarily limit to the above-described scheme in which a supervisorthread relinquishes its time slot to a worker, and so forth. In general,worker thread may refer to any thread to which some computational taskis allocated. The supervisor may represent any kind of overseeing orcoordinating thread responsible for actions such as: assigning workersto barrel slots (execution channels), and/or performing barriersynchronizations between multiple threads, and/or performing anycontrol-flow operation (such as a branch) in dependence on the outcomeof more than one thread.

Where reference is made to a sequence of interleaved time slots, or thelike, this does not necessarily imply that the sequence referred tomakes up all possible or available slots. For instance, the sequence inquestion could be all possible slots or only those currently active. Itis not necessarily precluded that there may be other potential slotsthat are not currently included in the scheduled sequence.

The term tile as used herein does not necessarily limit to anyparticular topography or the like, and in general may refer to anymodular unit of processing resource comprising a processing unit 10 andcorresponding memory 11, in an array of like modules, typically on thesame chip (same die).

Furthermore, where reference is made herein to performing asynchronization or an aggregation between a group of tiles, or aplurality of tiles or the like, this does not necessarily have to referto all tile on the chip or all tiles in the system unless explicitlystated. E.g. the SYNC and EXIT instructions could be configured toperform the synchronization and aggregation only in relation to acertain subset of tiles 4 on a given chip and/or only a subset of chips2 in a given system; whilst some other tiles 4 on a given chip, and/orsome other chips in a given system, may not be involved in a given BSPgroup, and could even be being used for some completely separate set oftasks unrelated to the computation being performed by the group at hand.

Further, the above-described synchronization schemes do not exclude theinvolvement, in embodiments, of external resources that are notprocessors such as one or more network cards, storage devices and/orFPGAs. For instance, some tiles may elect to engage in data transferswith an external system where these transfers form the computationalburden of that tile. In this case the transfers should be completedbefore the next barrier. In some cases the exit state of the tile maydepend on a result of the communication with the external resource, andthis the resource may vicariously influence the exit state.Alternatively or additionally, resources other than multi-tileprocessors, e.g. the host or one or more FPGAs, could be incorporatedinto the synchronization network itself. That is to say, a sync signalsuch as a Sync_req is required from this/these additional resources inorder for the barrier synchronization to be satisfied and the tiles toproceed to the next exchange phase. Further, in embodiments theaggregated global exit state may include in the aggregation an exitstate of the external resource, e.g. from an FPGA.

Also, while certain modes of SYNC instruction have been described above,the scope of the present disclosure more generally is not limited tosuch modes. For instance, the list of modes given above is notnecessarily exhaustive. Or in other embodiments, the SYNC instructionmay have fewer modes, e.g. the SYNC need not support differenthierarchical levels of external sync, or need not distinguish betweenon-chip and inter-chip syncs (i.e. in an inter-tile mode, always acts inrelation to all tiles regardless of whether on chip or off chip).

In further variations, the SYNC instruction could take a greater numberof possible modes to accommodate a greater granularity or range ofhierarchical sync zones 91, 92; or simply a different set of modes toaccommodate different division of the system into hierarchical zones.For instance, as well as allowing selection between internal (on-chip)and external (off-chip) synchronization (or even as an alternative tothis), the modes of the SYNC instruction may be configured to recognizeother physical breakpoints further out beyond one chip (e.g. one ICpackage, one card, one box of cards etc.). Or even if no dedicated SYNCinstruction is used, such divisions may be implemented by the programmeror compiler using general purpose code. So in embodiments, one of thehierarchical sync zones (e.g. one of the modes of the SYNC instruction)may consist of all the tiles on all the chips on the same IC package(but none of the tiles or chips beyond that). Alternatively oradditionally, one of the hierarchical sync zones (e.g. again one of themodes of the SYNC instruction) may consist of all the tiles on all thechips on the same card (but none of the tiles, chips or packages beyondthat). As another alternative or additional example, one of thehierarchical sync zones (e.g. again another possible mode of the SYNCinstruction) may consist of all the tiles on all the chips on all thecards in the same physical box, e.g. same chassis (but none of thetiles, chips or boxes beyond that). This would be advantageous becausecommunication between IC packages, cards and boxes will tend to incur aneven greater penalty than just between chips (dies) in the same package.

Furthermore, the sync zones are not limited to being hierarchical (i.e.one nested in another), and in other embodiments the selectable synczones may consist of or include one or more non-hierarchical groups (alltiles of that group not nested within a single other selectable group).

In yet further variants, the synchronization is not limited to beingperformed using dedicated SYNC instructions, nor the EXIT instructions.In other cases the synchronization functionality could be achieved usinggeneral purpose code. Further, where the SYNC instruction and/or EXITinstructions are used, they do not necessarily have to have thedescribed function of aggregating exit states.

Other applications and variants of the disclosed techniques may becomeapparent to a person skilled in the art once given the disclosureherein. The scope of the present disclosure is not limited by thedescribed embodiments but only by the accompanying claims.

What is claimed is:
 1. A processor comprising: an arrangement ofmultiple tiles on the same chip, each tile comprising its own separaterespective processing unit and memory including program memory and datamemory, wherein separate portions of program code are arranged to run inparallel in different ones of the tiles; an on-chip interconnectarranged to enable the code run on the different tiles to communicatebetween tiles; and an external interconnect comprising anon-time-deterministic mechanism implemented in dedicated hardware logicfor communicating data off-chip, whereby data is sent over the externalinterconnect in the form of packets, each packet having a header inwhich a destination address is present, and whereby communication ofpackets over the external interconnect is non-time-deterministic;wherein the external interconnect comprises an external exchange blockconfigured to provide flow control and queuing of the packets; whereinone of the tiles is nominated by a compiler of the code to send anexternal exchange request message to the exchange block, the externalexchange request message comprising one or more control packetsindicating which of the tiles have data packets to send to a destinationon another chip; and wherein the exchange block is configured to performsaid flow control by: A) sending an exchange-on control packet to afirst of the tiles indicated in the exchange request message as havingdata to send externally, to cause the first tile to start sendingpackets to their destinations via the external interconnect, beingqueued in a queue of the exchange block; and then B) once this tile hassent its last data packet, sending an exchange-off control packet tothis tile to cause it to stop sending packets, and sending anotherexchange-on control packet to the next tile indicated in the exchangerequest message as having data packets to send.
 2. The processor ofclaim 1, wherein the destination of at least some of the packets isanother tile or tiles on another chip.
 3. The processor of claim 1,wherein the destination of at least some of the packets is a hostsubsystem comprising a host CPU, and said processor is arranged as awork accelerator to perform work allocated by the host.
 4. The processorof claim 1, wherein the destination of at least some of the packets is astorage device.
 5. The processor of claim 1, wherein the internalinterconnect is a time-deterministic interconnect, the communication ofdata between tiles on chip being time-deterministic.
 6. The processor ofclaim 1, wherein at the physical layer the external interconnectmechanism is lossy, but at the transaction layer the mechanism is notlossy due to an architecture whereby, if a packet is not acknowledged,it will be resent automatically by hardware in the externalinterconnect.
 7. The processor of claim 1, wherein the exchange block isconfigured so as, if at any time the exchange block is unable tocontinue sending packets over the external interconnect, the exchangeblock sends an exchange-off control packet to the sending tile beforethe exchange block's queue overflows; and once the congestion is clearedand the exchange block has sufficient space in its queue it will send anexchange-on control packet to the sending tile allowing it to continuetransmitting its content.
 8. The processor of claim 1, wherein theexternal interconnect takes the form of a network and the header furthercomprises information for routing purposes.
 9. The processor of claim 1,wherein the external interconnect is configured to useclock-data-recovery technology to infer a clock from a received datastream having sufficient data signal transitions to maintain a bit-lock.10. The processor of claim 1, wherein the external interface isconfigured to send the packets to the destination or destination via aPCI, PCIe or Ethernet bus or network between the external interface andthe destination or destinations.
 11. The processor of claim 1, wherein agroup of some or all of the tiles modules is programmed to operate in aseries of bulk synchronous parallel, BSP, supersteps, whereby in eachsuperstep the group performs: a compute phase in which the tiles in thegroup performs computations but does not exchange results of thecomputations outside the chip, and then an exchange phase in which atleast some of the tiles in the group exchange the results of one or moreof the computations with the off-chip destination or destinations, saidat least some of the tiles being those indicated in the exchangerequest; and the group is synchronized by a barrier synchronizationbetween each current superstep in the series and the next, whereby eachtile in the group waits for all in the group to complete the computephase of the current superstep before advancing to the exchange phase ofthe next superstep.
 12. The processor of claim 11, wherein the on-chipand/or external interconnect comprises hardware logic configured toconduct said barrier synchronization by: receiving a sync request fromeach of the tiles in the group, and issuing a sync acknowledgement oncondition that the sync requests are received from all of the group;wherein each of the tiles in the group is further configured to suspendinstruction issue in the respective processing unit the issue of thesync acknowledgment.
 13. The processor of claim 12, wherein therespective processing unit on each of the tiles is configured to executeinstructions from a predefined instruction set; and wherein theinstruction set of some or all of the tiles comprises a sync instructionwhich causes the tile on which it is executed to send the sync request.14. The processor of claim 1, wherein the exchange block comprises aplurality of exchange block contexts, each configured to implement aninstance of said flow control mechanism for a different respectivesubset of the tiles.
 15. The processor of claim 1, comprising at leasttwenty of said tiles.
 16. The processor of claim 1, arranged to performsaid sending without using a DMA engine, wherein instead a subset of thetiles are nominated by the compiler to act as I/O tiles to perform saidsending of data to the off-chip destination and/or to read data from theoff-chip destination, said subset being the tiles indicated in theexchange request message.
 17. The processor of claim 16, wherein theexternal interface is configured to send the packets to the destinationor destination via a connection between the external interface and thedestination or destinations, said connection having a first bandwidthfor sending the packets; and wherein each of the tiles has a secondbandwidth for sending the packets, wherein the number of tiles nominatedas I/O tiles is at least the first bandwidth divided by the secondbandwidth rounded up or down to the nearest whole number.
 18. A systemcomprising the processor of claim 1, and the off-chip destination ordestinations of the packets.
 19. A method of operating the processor ofclaim 1, the method comprising: running the compiler on a computer inorder to compile the code, wherein the compilation comprises thecompiler nominating which of the tiles is to send the exchange requestmessage; and running the compiled code on the processor, thereby causingthe nominated tile to send the exchange request message to the exchangeblock to cause the exchange block to perform said queuing and flowcontrol, and causing the tiles indicated in the exchange request messageto perform the sending of their packets.
 20. The method of claim 19,wherein: if at any time the exchange block is unable to continue sendingpackets over the external interconnect, the exchange block sends anexchange-off control packet to the sending tile before the exchangeblock's queue overflows; and once the congestion is cleared and theexchange block has sufficient space in its queue it sends an exchange-oncontrol packet to the sending tile allowing it to continue transmittingits content; and the congestion is due, at least in part, to oversubscription of the external interconnect.
 21. The method of claim 19,wherein: if at any time the exchange block is unable to continue sendingpackets over the external interconnect, the exchange block sends anexchange-off control packet to the sending tile before the exchangeblock's queue overflows; and once the congestion is cleared and theexchange block has sufficient space in its queue it sends an exchange-oncontrol packet to the sending tile allowing it to continue transmittingits content; and the congestion is due, at least in part, to previouspacket loss and re-transmission in the external interconnect.
 22. Themethod of claim 19, wherein: said sending is performed without using aDMA engine, wherein instead a subset of the tiles are nominated by thecompiler to act as I/O tiles to perform said sending of data to theoff-chip destination and/or to read data from the off-chip destination,said subset being the tiles indicated in the exchange request message;and said compilation comprises the compiler nominating which of thetiles are the I/O tiles.